Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Re^2: Save all but line 32!

by zigdon (Deacon)
on Sep 18, 2002 at 19:58 UTC ( [id://198987]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Save all but line 32!
in thread Save all but line 32!

I thought $. only resets on a close call? meaning the <> operator doesn't reset it, since it never closes the filehandles. So the following code will omit the 35th line only for the first file, but not for any other file:
perl -ne 'print unless $. == 35' file1 file2
Is that correct?

-- Dan

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://198987]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (7)
As of 2024-04-19 17:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found