toolic, even though it is unsolicited, it is very good advice. I keep forgetting that there are more ways to loop iterate than for. I could find myself doing something akin to...
my @list = qw(oof rab zab);
my $last = pop(@list);
for my $thing (@list) {
print $thing.'-';
}
print $last;
instead of...
my @list = qw(oof rab zab);
print join('-',@list);
Ridiculous, I know, but I have probably written similar code plenty of times. My overdependence on for has lead to longer and probably more agonizing code. So, thank you for reminding me of a simpler way to do that loop and other loops I may have that are just like it!
Have a cookie and a very nice day!
Lady Aleena
|