laziness, impatience, and hubris | |
PerlMonks |
Re: Re: Print all lines in a file except the last twoby Jasper (Chaplain) |
on May 20, 2004 at 15:50 UTC ( [id://354985]=note: print w/replies, xml ) | Need Help?? |
Why a counter and imply it's short when you have a foreach, and a print"$_" ?
print for@f[0..-2] is shorter. Edit: Wow, I really do live in a little fluffy bunny world where everyone's happy, there's no war, pizza isn't fattening, Darth Vader was never an annoying child, the Six million Dollar Man really was a good tv show, new shoes are comfy, my girlfriend's bum never looks big in this, and code like this works. Kind of surprised I didn't lose all the xp I'd ever gotten on this one. hardburn posted the correct code below.
In Section
Seekers of Perl Wisdom
|
|