Re: Replace words in a file using perl script

2011-12-16 Thread Brandon McCaig
On Thu, Dec 15, 2011 at 07:36:37AM -0800, Melvin wrote: > Hi, Hello: > I was trying to write a script to replace baby to bigboy in a file:- > However the below script doesn't work Could someone help me??? > > #!/usr/bin/perl -w > use strict; > > open (FILE_IN , $ARGV[0]) || die ("ERROR: Gimme I

Re: Replace words in a file using perl script

2011-12-16 Thread Uri Guttman
On 12/16/2011 03:23 PM, Chris Stinemetz wrote: Hello Melvin, Give this a try. I used the advice Jim gave and this is what I came up with. It seems to do what you are asking for. #!/usr/bin/perl use warnings; use strict; my $inFile = "input.txt"; my $outFile = "output.txt"; open my $fin, '<',

Re: Replace words in a file using perl script

2011-12-16 Thread Chris Stinemetz
Hello Melvin, Give this a try. I used the advice Jim gave and this is what I came up with. It seems to do what you are asking for. #!/usr/bin/perl use warnings; use strict; my $inFile = "input.txt"; my $outFile = "output.txt"; open my $fin, '<', $inFile or die "ERROR opening $inFile: $!"; open

RE: Replace words in a file using perl script

2011-12-16 Thread Kronheim, David (Contr)
Hi Melvin, It looks like you're editing each line but not writing back to the file, add some print's or say's for $line to see what's happening. Sincerely, David Kronheim Production Support Tier II Gateway Error Correction, VZ450 EDI, EDI Billing, & Metakey/LIA 484-213-1315 __

Re: Replace words in a file using perl script

2011-12-16 Thread Jim Gibson
On 12/15/11 Thu Dec 15, 2011 7:36 AM, "Melvin" scribbled: > Hi, > > I am a Perl baby :-) > > I was trying to write a script to replace baby to bigboy in a file:- > However the below script doesn't work Could someone help me??? The problem with your script is that you are not writing out the