Help for this page

Select Code to Download


  1. or download this
    % perl -le '$b=[1..4]; $#a=$b; print $#{$#a}'
    3
    
  2. or download this
    % perl -le '$b=[1..4]; $#a=$b; print @{$#a}; push @$b, 5; print @{$#a}
    +'
    1234
    12345
    
  3. or download this
    % perl -le '$b=[1..4]; $#a=$b; print $#a->[2]'
    3
    ...
    
    % perl -le '$b={foo=>1}; $#a=$b; print keys %{$#a}'
    foo
    
  4. or download this
    % perl -le 'sub foo{"foo"} $b=bless[]; $#a=$b; print $#a->foo'
    Can't call method "foo" without a package or object reference at -e li
    +ne 1.
    
  5. or download this
    % perl -le '$b=[1..4]; $#a=$b; print ref $#a'
    [nothing]
    
  6. or download this
    % perl -le '$b=[1..4]; $#a=$b; $x=$#a; print @$x'
    [nothing]
    
  7. or download this
    % perl -le '$b=[1..4]; $#a=$b; $x=$#a; print @{$#a}' 
    [nothing]
    
  8. or download this
    #/usr/bin/perl -l
    my@a=qw[just another perl hacker];$#a=\@a;
    print "@{$#{$#{$#{$#{$#{$#{$#{$#a}}}}}}}}"