Help for this page

Select Code to Download


  1. or download this
    foreach my $i( ['kept', 82], ['notkept', 1], ['repaired', 3] ) { ...
    # so $aref->[$i][0]
    # looks like $areg->[ ['kept', 82] ][0]
    #
    
  2. or download this
    $ perl buggy_array.pl 2> out.txt
    
    ...
    Use of uninitialized value in concatenation (.) or string at ary.pl li
    +ne 21.
    Use of reference "ARRAY(0x1d0fbf8)" as array index at ary.pl line 21.
    Use of uninitialized value in concatenation (.) or string at ary.pl li
    +ne 21.
    
  3. or download this
    perl -E 'my $aref=[undef]; say 0 + $aref'
    19468616
    
  4. or download this
    $areg->[ ['kept', 82] ][0]
    
    # becomes something like
    # $areg->[ 9999999 ][0]
    # (or whatever the memory address of that array is...)
    
  5. or download this
    perl -E 'my $aref=[undef]; $aref->[1000][0]; say scalar @{ $aref }'
    1001