Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^2: “A meeting at the Liquor-Vodka Factory”, or… same ARRAY questions again?!!

by Anonymous Monk
on Sep 03, 2005 at 09:46 UTC ( #488890=note: print w/replies, xml ) Need Help??


in reply to Re: “A meeting at the Liquor-Vodka Factory”, or… same ARRAY questions again?!!
in thread “A meeting at the Liquor-Vodka Factory”, or… same ARRAY questions again?!!

--> What is the index of the first element of an array in Perl?

0

Actually,
$[ The index of the first element in an array, and of the fir +st character in a substring. Default is 0, but you could theoretically set it to 1 to make Perl behave more like aw +k (or Fortran) when subscripting and when evaluating the index() + and substr() functions. (Mnemonic: [ begins subscripts.) As of release 5 of Perl, assignment to $[ is treated as a compiler directive, and cannot influence the behavior of a +ny other file. (That's why you can only assign compile-time constants to it.) Its use is highly discouraged. Note that, unlike other compile-time directives (such as strict), assignment to $[ can be seen from outer lexical s +copes in the same file. However, you can use local() on it to st +rictly bound its value to a lexical block.
  • Comment on Re^2: “A meeting at the Liquor-Vodka Factory”, or… same ARRAY questions again?!!
  • Download Code

Replies are listed 'Best First'.
Re^3: “A meeting at the Liquor-Vodka Factory”, or… same ARRAY questions again?!!
by ikegami (Patriarch) on Sep 03, 2005 at 16:54 UTC
    Shoot, you're right. I consider $[ deprecated, so I never think of it.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2023-12-04 03:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?











    Results (20 votes). Check out past polls.

    Notices?