Re: Can't print to file

2005-12-07 Thread David Sudjiman
On Tue, 6 Dec 2005, John W. Krahn wrote: > Because the null filehandle inside the readline operator ( <> ) has special > magic which works together with the @ARGV array and the $^I scalar but does > not work with ordinary filehandles. > > See the "I/O Operators" section of perlop.pod for an explan

Re: Can't print to file

2005-12-06 Thread John W. Krahn
David Sudjiman wrote: > This is my script. > > === > #!/usr/bin/perl > # ex9-2b.pl > > use strict; > use warnings; > > my ($filename) = @ARGV; > > open FILE, $filename or die "Can't open $filename : $!"; > > $^I = ".out"; > while () { >s/Fred/Larry/i; >print; > } > === > > I execut

Can't print to file

2005-12-06 Thread David Sudjiman
This is my script. === #!/usr/bin/perl # ex9-2b.pl use strict; use warnings; my ($filename) = @ARGV; open FILE, $filename or die "Can't open $filename : $!"; $^I = ".out"; while () { s/Fred/Larry/i; print; } === I executed using: $ perl ex9-2b.pl fred_larry.txt AlLarry Larrydy Larryd