To iterate through my @test = ('this','that','the other','thing') I used to write:
foreach $num (@test) { print $test[$num] . "\n"; }
or even worse:
I now simply bang out: print $_ . "\n" foreach @test; The less typing the better. Noone can accuse me of not being lazy. Other examples that have really changed my Perl world view include Ovid's node Death to dot star!, which really got me thinking about character classes and tilly's unique way of calling subs.for($num=0;$num<@test;$num++) { print $test[$num] . "\n"; }
Armed with this knowledge, I've been producing faster, more maintainable scripts for fun and profit. Many thanks to all the saints (and you lesser creatures, too) who toil to enlighten the flock.
Some people work very hard but still they never get it right
Well, I'm beginning to see the light
aside: Please do not ++ this node as it's not an XP trap. My sincerest thanks to the community.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Beginning to see the light....
by lemming (Priest) on Jul 12, 2001 at 01:41 UTC | |
|
Re: Beginning to see the light....
by myocom (Deacon) on Jul 11, 2001 at 22:30 UTC | |
by Anonymous Monk on Jul 11, 2001 at 23:13 UTC | |
by Abigail (Deacon) on Jul 12, 2001 at 01:39 UTC | |
by earthboundmisfit (Chaplain) on Jul 12, 2001 at 01:44 UTC | |
by Chady (Priest) on Jul 12, 2001 at 11:24 UTC | |
by myocom (Deacon) on Jul 12, 2001 at 18:49 UTC | |
|
Re: Beginning to see the light....
by particle (Vicar) on Jul 11, 2001 at 23:58 UTC | |
|
Re: Beginning to see the light....
by E-Bitch (Pilgrim) on Jul 11, 2001 at 23:42 UTC |