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

Re: number array with space

by farang (Chaplain)
on Jun 20, 2013 at 05:32 UTC ( #1039883=note: print w/replies, xml ) Need Help??


in reply to number array with space

Please provide enough code to reproduce the problem. Are you following recommended practice by using 'strict' to ensure there is no typo in the array name? If so, the error isn't coming from the code you posted.

Also, note that your loop does not execute as many times as there are elements in the array, since an array is zero-based.

use strict; use warnings; my @test_num_tgb = qw/a b c d/; for (my $j=1;$j<=$#test_num_tgb;$j++) { print $test_num_tgb[$j]; print "\n"; }
As you can see, this skips printing the zeroeth element 'a'.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1039883]
help
Chatterbox?
[Discipulus]: The red sphinx is about Rechilieu, absolutely thrilling
[erix]: thanks, Discipulus - I got them lined up at gutenberg :)
[erix]: I red the musketeers and Monte Cristo but both a very long time ago (many decades ago)
[erix]: *read
[Discipulus]: dunno if a young people can well understand the deep of Montecristo

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (7)
As of 2017-05-24 07:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?