Hello,

Now it's change the file.
Very funny :)

if I want the user type one IP.
I saw the example guestbook.cgi.

Perhaps still :


my $ip;
print IP "To: $ip\n";
for (@file) 
  {
    s/192.168.1.85/$ip/g;
     print FILE $_;
   }


thanks again !
 

--- Jeff Pang <[EMAIL PROTECTED]> escreveu:

> > 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!
> 
> -- 
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> http://learn.perl.org/
> 
> 
> 


__________________________________________________
Fale com seus amigos  de graça com o novo Yahoo! Messenger 
http://br.messenger.yahoo.com/ 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to