Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/env perl -l
    
    ...
        print 'Value: ', defined $x[$i] ? $x[$i] : '<undef>';
    }
    print 'Elements in @x: ', scalar @x;
    
  2. or download this
    *** Create @x with no elements ***
    Elements in @x: 0
    ...
    Index: 32
    Value: <undef>
    Elements in @x: 22
    
  3. or download this
    @hash{'goodbye', 'world'} = ();
    
  4. or download this
    #!/usr/bin/env perl
    
    ...
    $hash{goodbye} = ()[0];
    $hash{world} = ()[1];
    print Dumper \%hash;
    
  5. or download this
    $VAR1 = {
              'hello' => 1,
    ...
              'world' => undef,
              'mars' => 4
            };
    
  6. or download this
    #!/usr/bin/env perl
    
    ...
    
    @hash{'goodbye', 'world'} = ('farewell');
    print Dumper \%hash;
    
  7. or download this
    $VAR1 = {
              'hello' => 1,
    ...
              'world' => undef,
              'mars' => 4
            };