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

Re: Pattern not manipulating file output

by hipowls (Curate)
on Feb 20, 2008 at 05:22 UTC ( [id://668951]=note: print w/replies, xml ) Need Help??


in reply to Pattern not manipulating file output

  • You are opening OUT for read, it shoud be open OUT, ">$file";
  • The file name for OUT is the same as the flie name of IN, you will find that you clobber the contents on $file before you do anything

Open a tempory file, say "$file.tmp", write to that and then rename it to $file

Put

use strict; use warnings;
at the start of the script

Check you open the file handle

open IN, $file or die "Can't open $file: $!\n";

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (1)
As of 2024-04-26 02:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found