Erwin Zavala wrote:
> My export.txt file has data in the format
> 
> Joe Doe mail: [EMAIL PROTECTED]
> 
> I want my script to replace mail for email.  At the end of the script
> I get an empty file? Why what am i doing wrong
> 
> #!/user/bin/perl
> 
> open(openFile,  "<export.txt");
> open(writeFile, ">export.txt");
        Need to open another file for output. You can't use it unless you read the 
whole file in, close and reopen.

> while(<openFile>)
> {
 s/mail/email/g; 
# 
# You want to change but also write out all the other lines otherwise you will only 
write out the 
# changed lines and I assume you want them all.

 print writeFile ;
> }
> 

Wags ;)


**********************************************************
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.
****************************************************************


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to