Re: Example Input Datas

[email protected] (Rodrigo Tavares)
Newsgroups perl.beginners.cgi
Message-ID <[email protected]>
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/
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.