Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^2: how internally $#array is working in Perl

by sflitman (Hermit)
on Aug 13, 2010 at 06:00 UTC ( [id://854839]=note: print w/replies, xml ) Need Help??

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
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://854839]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2024-04-19 04:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found