Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: why the array index has to start at 0??

by citromatik (Curate)
on Jun 23, 2009 at 10:17 UTC ( #773942=note: print w/replies, xml ) Need Help??


in reply to why the array index has to start at 0??

It hasn't:

use strict; use warnings; use feature qw/ :5.10 /; my @ar = qw/1 2 3 4 5/; $[=1; say $ar[$_] for (1..@ar);

Although you may not want to do that. See perlvar

citromatik

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://773942]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2017-02-22 05:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?






    Results (324 votes). Check out past polls.