in reply to literal lists
Walks the values 0, 1 and 2.my ( @a, @b ); @a = ( 1, 2, 3 ); foreach ( 0 .. $#a ) { }
does nothing. But $#b returns -1 because there are no values in it. If it would count down, It'd walk the values 0 and -1.foreach ( 0 .. $#b ) { }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: literal lists
by danmcb (Monk) on Sep 06, 2005 at 12:03 UTC | |
by gellyfish (Monsignor) on Sep 06, 2005 at 12:10 UTC | |
by danmcb (Monk) on Sep 06, 2005 at 12:42 UTC |