Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

Re: Re: Print all lines in a file except the last two

by Jasper (Chaplain)
on May 20, 2004 at 15:50 UTC ( #354985=note: print w/replies, xml ) Need Help??

in reply to Re: Print all lines in a file except the last two
in thread Print all lines in a file except the last two

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.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://354985]
[RonW]: choroba: Please define "high end" and "low end"
[LanX]: choroba: subversive (as usual ;)
[james28909]: i dunno, if i didnt have so little experience in linux i would swap. but it would be to much of a learning curve for me right now.
[choroba]: Low-end is defined as the Perl that generates millions of income
[choroba]: sorry, that's high-end, of coursse
[choroba]: low end, in my talk, will be code that "we don't touch because it works" and noone knows why
[choroba]: I want to present the most bizzare bugs and misfeatures I met when working for a large financial institution
[choroba]: I already gave a similar talk to my friends in a pub and at an internal conference at work and people liked it, so maybe...
[choroba]: LanX: That's the heritage, I can't do anything else
[RonW]: Sounds like some system my employer has "It does exactly what we need it to do and can't afford to risk anything we can't prove is 100% compatible"

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (11)
As of 2017-05-22 21:35 GMT
Find Nodes?
    Voting Booth?