Help for this page

Select Code to Download


  1. or download this
    my $x;
    my $str = sub { "hello ".${\$x} };
    ...
    print $str->();
    $x = 'chickenman';
    print $str->();
    
  2. or download this
    {package XYZ;
    sub new {
    ...
    print "homedir: ".$xyz->homedir()."\n";
    print "exec: ".$xyz->executable()."\n";
    # note, when dealing with paths use File::Spec->catdir()