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)
Metakey/LIA 484-213-1315 From: Melvin [whereismel...@gmail.com] Sent: Thursday, December 15, 2011 10:36 AM To: beginners@perl.org Subject: Replace words in a file using perl script Hi, I am a Perl baby :-) I was trying to write a script to replace baby to bigboy in a file:-

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

Replace words in a file using perl script

2011-12-16 Thread Melvin
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??? #!/usr/bin/perl -w use strict; open (FILE_IN , $ARGV[0]) || die ("ERROR: Gimme Input pleease"); my @array_of_lines = ; foreach my $line