Help for this page

Select Code to Download


  1. or download this
    for my $name (@colors) {
      no strict 'refs';    # allow symbol table manipulation
      *$name = sub { "<FONT COLOR='$name'>@_</FONT>" };
    }
    
  2. or download this
    use strict;
    use warnings;
    ...
    print "green:  ${\(green())}\n";
    print "violet: ${\(violet())}\n";
    
  3. or download this
    ----- $name is constant inside sub ------
    red:    <FONT COLOR='red'></FONT>
    ...
    red:    <FONT COLOR='something wacky and wonderful'></FONT>
    green:  <FONT COLOR='something wacky and wonderful'></FONT>
    violet: <FONT COLOR='something wacky and wonderful'></FONT>
    
  4. or download this
    ----- $name is constant inside sub ------
    Use of uninitialized value in concatenation (.) or string at ...
    ...
    red:    <FONT COLOR='something wacky and wonderful'></FONT>
    green:  <FONT COLOR='something wacky and wonderful'></FONT>
    violet: <FONT COLOR='something wacky and wonderful'></FONT>