Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

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

by zigdon (Deacon)
on Sep 18, 2002 at 19:58 UTC ( #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
Node Status?
node history
Node Type: note [id://198987]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (1)
As of 2020-10-24 12:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (243 votes). Check out past polls.

    Notices?