Help for this page

Select Code to Download


  1. or download this
    perl -E 'say "undefined" if ! defined($var);'
    
  2. or download this
    perl -E '$var = 1; say "defined" if defined($var);'
    
  3. or download this
    perl -E 'say "Hello" if undef == 0;'
    
  4. or download this
    my $var;  # Currently $var is undef
    print $var + 5, "\n"; # 5
    print ++$var, "\n";   # 1
    
  5. or download this
    my %hash;
    $hash{foo} = { bar => 'baz' };
    
  6. or download this
    %hash = (
      foo => {        # { is an anon-hash constructor
        bar => 'baz'
      }
    );
    
  7. or download this
    my %hash;
    $hash{foo}{bar} = 'baz';