Help for this page

Select Code to Download


  1. or download this
    my $t = 'test';
    print eval '$t';  # test
    
  2. or download this
    my $t1 = 'test1';
    sub show { print eval "\$$_" for @_; }
    my $t2 = 'test2';
    show(qw( t1 t2 ));  # test1, but not test2
    
  3. or download this
    {
       my $t = 'test';
       sub show { print eval "\$$_" for @_; }
    }
    show(qw( t ));  # Nothing
    
  4. or download this
    {
       my $t = 'test';
    ...
       sub show { print eval "\$$_" for @_; }
    }
    show(qw( t ));  # Nothing
    
  5. or download this
    {
       my $t = 'test';
       sub show { $t; print eval "\$$_" for @_; }
    }
    show(qw( t ));  # test