Unnamed
public text v1 · immutableuse strict;
use warnings;
my %colors = (
blue => "#0000ff",
red => "#ff0000",
green => "#00ff00",
);
{
no strict;
while (my ($color, $color_code) = each(%colors)) {
*$color = sub {
"<font color=\"$color_code\">@_</font>";
};
}
}
print red("Hello"), "\n";
print green("World"), "\n";