Help for this page

Select Code to Download


  1. or download this
    $[
    
    ...
    Note that, unlike other compile-time directives (such as strict), assi
    +gnment to 
    $[ can be seen from outer lexical scopes in the same file. However, yo
    +u can use 
    local() on it to strictly bind its value to a lexical block.
    
  2. or download this
    perl -le '@arr=qw(10 1 2 3 4);$[=1;print $arr[$_],"\t",$_ for 0 .. $#a
    +rr;'
    10    0
    10    1
    ...
    2    3
    3    4
    4    5