Help for this page

Select Code to Download


  1. or download this
    use warnings; use strict;
    my %global;
    ...
    try(0) => globalvar doesn't exist
    try(1) => globalvar exists
    try(0) => globalvar exists
    
  2. or download this
    use warnings;
    use strict;
    ...
    $xyz = 1;
    if($xyz) { eval { $main::globalvar = undef; print STDERR __LINE__, ": 
    +eval'd\n"} }
    printf "%d: if(%d) => did eval => '%s'\n", __LINE__, $xyz, defined $ma
    +in::globalvar ? $main::globalvar : '<undef>';