Re: Example Input Datas

[email protected] (Jeff Pang)
Newsgroups perl.beginners.cgi
Message-ID <7775127.1173359091843.JavaMail.root@elwamui-cypress.atl.sa.earthlink.net>
> s/192.168.1.85/10.0.0.1/g
>     print FILE $_;

hello,

Here the first line you lost a ';' at the end.
The whole script I've tested fine as below:

use CGI qw(:standard);
use CGI::Carp qw(warningsToBrowser fatalsToBrowser);
use strict;

print header;
print start_html("Modify Information");

my $file = '/tmp/test.txt';
open FILE,$file or die $!;
my @file = <FILE>;
close FILE;

open FILE,">",$file or die $!;
for (@file) {
    s/192.168.1.85/10.0.0.1/g;
    print FILE $_;
}
close FILE;
print end_html;

__END__

Hope this helps!
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.