Hi Irfan
You can do all four task like below
1: open FILE ,">filename.txt" or die$!;
2: my @lines=<FILE>
3: do changes through sed
Like sed -e 's/original pattern/new pattern/p' filename
4:if you did changes it automatically get saved
5: close(FILE);
Thanks
Ajay
-----Original Message-----
From: Irfan Sayed [mailto:[email protected]]
Sent: Wednesday, June 17, 2009 2:42 PM
To: [email protected]
Subject: file handle in perl
Hi All,
I am struggling with file handling in perl. i want to do following operation .
1: open the file
2: read the file
3: do the changes in specific lines
4: save the file
5: close the file
i am not getting which operand i should use to do this operation . i tried all
operands like >, >>, <, +<, +>
please advice
here is the line which i am using to open the file
open (FILE, "+<", '.\Metrino\MonitoringSystem\Rtu\RtuInstallKit\EXFO RTU
System\EXFO RTU System.vdproj') or die "Couldn't open for reading: $!\n";
plz plz advic
regards
Irf
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/