bivouac has asked for the wisdom of the Perl Monks concerning the following question:
The regex works, but it doesn't output anything to the file I'm opening. I'm guessing that I need a if statement by the regex and a print statement.....anyone?#!/usr/bin/perl -w use strict; open(FOO, "+< $foo") or die "Can't open $foo: $!"; while (<FOO>) { chomp; my $line = $_; $line = s/hello/goodbye/gi; } close FOO;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Editing Contents of a File
by pbeckingham (Parson) on Jun 21, 2004 at 13:58 UTC | |
|
Re: Editing Contents of a File
by ColtsFoot (Chaplain) on Jun 21, 2004 at 13:54 UTC | |
|
Re: Editing Contents of a File
by borisz (Canon) on Jun 21, 2004 at 13:57 UTC | |
|
Re: Editing Contents of a File
by hmerrill (Friar) on Jun 21, 2004 at 14:05 UTC | |
by bivouac (Beadle) on Jun 21, 2004 at 17:09 UTC | |
|
Re: Editing Contents of a File
by eserte (Deacon) on Jun 21, 2004 at 14:46 UTC | |
|
Re: Editing Contents of a File
by blue_cowdawg (Monsignor) on Jun 21, 2004 at 15:08 UTC |