Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Update works for line...deletes other records

by 7stud (Deacon)
on Feb 21, 2013 at 07:52 UTC ( #1019908=note: print w/ replies, xml ) Need Help??


in reply to Update works for line...deletes other records

From 'man perlrun':

 -i[extension]
            specifies that files processed by the "<>" construct are to be
            edited in-place.  It does this by renaming the input file, opening
            the output file by the original name, and selecting that output
            file as the default for print() statements. 

Okay, so once perl renames the original file, the original file name doesn't exist anymore. Subsequently, when perl opens a file name that doesn't exist for writing, what's in that file to start?


Comment on Re: Update works for line...deletes other records
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (10)
As of 2014-12-29 16:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (193 votes), past polls