Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Perl Beginners Cgi > Re: Example Inp...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 2 Topic 1378 of 1496
Post > Topic >>

Re: Example Input Datas

by pangj@[EMAIL PROTECTED] (Jeff Pang) Mar 8, 2007 at 09:04 PM

> 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 @[EMAIL PROTECTED]
 = <FILE>;
close FILE;

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

__END__

Hope this helps!
 




 2 Posts in Topic:
Re: Example Input Datas
pangj@[EMAIL PROTECTED]   2007-03-08 21:04:51 
Re: Example Input Datas
digolinopage@[EMAIL PROTE  2007-03-08 11:03:35 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Nov 22 11:42:17 CST 2008.