Re: Example Input Datas

2007-03-08 Thread Rodrigo Tavares
Hello Jeff, Well, thanks your help. More one thing. When I try to run the cgi in browser come this message Software error: No comma allowed after filehandle at /home/faria/public_html/cgi-bin/perl/entrada-dados.cgi line 19. See my below code. print header; print start_html(Modify

Re: Example Input Datas

2007-03-08 Thread Jeff Pang
print FILE,$_; Here comma is not needed. change to: print FILE $_; Also I'd suggest you always add the use strict at the begin of your cgi scripts. -Original Message- From: Rodrigo Tavares [EMAIL PROTECTED] Sent: Mar 8, 2007 8:04 PM To: beginners-cgi@perl.org Subject: Re: Example

Re: Example Input Datas

2007-03-08 Thread Rodrigo Tavares
Hello Jeff, Other error has come: syntax error at home/faria/public_html/cgi-bin/perl/entrada-dados.cgi line 19, near print Execution of /home/faria/public_html/cgi-bin/perl/entrada-dados.cgi aborted due to compilation errors. My all code is a below. #!/usr/bin/perl -wt use CGI qw(:standard);

Re: Example Input Datas

2007-03-08 Thread Jeff Pang
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

Re: Example Input Datas

2007-03-08 Thread Rodrigo Tavares
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:

Re: Example Input Datas

2007-03-08 Thread Jeff Pang
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 $_; } What would you like to say? -- http://home.arcor.de/jeffpang/ -- To

Re: Example Input Datas

2007-03-08 Thread Rodrigo Faria Tavares
Hi Jeff, This IP 192.168.1.1 will replaced by IP defined from user. example: Enter with IP : 10.0.0.1 Submit When somebody to type one value, it will replaced the file value. IP: 192.168.1.1 - will be replaced - 10.0.0.1 best regards, Rodrigo Faria - Original Message - From:

Re: Example Input Datas

2007-03-08 Thread Jeff Pang
Hi Jeff, This IP 192.168.1.1 will replaced by IP defined from user. example: Enter with IP : 10.0.0.1 Submit When somebody to type one value, it will replaced the file value. IP: 192.168.1.1 - will be replaced - 10.0.0.1 Got it.Then your script is may right. The only note is the

Re: confused about a regex

2007-03-08 Thread Jeni Zundel
I have to say - I am totally enamored with regex. Color me 'goober'. I just think that is a beautiful, concise, elegant way to make a substitution. All of that capability in one short string of characters... No if, then, else construct. Just - capture what is there; if it matches a .\w

Query on pattern matching

2007-03-08 Thread Dharshana Eswaran
Hi all, I need to extract few strings from one file and paste it to another file. My source file, i.e., my .h file, contains statements like: #define GMMREG_ATTACH_REQ_ID (GMMREG_PRIM_ID_BASE) /* @LOG GMMREG_ATTACH_REQ */ #define GMMREG_DETACH_REQ_ID

Re: confused about a regex

2007-03-08 Thread oryann9
$_=abc.e.i; This is short for: $_ = 'abc' . 'e' . 'i'; Which is the same as saying: $_ = 'abcei'; Why is $_=abc.e.i short for $_ = 'abc' . 'e' . 'i'; Is it b/c each group of characters is a 'token' including the periods? abc = token . = token

Re: Query on pattern matching

2007-03-08 Thread Chas Owens
On 3/8/07, Dharshana Eswaran [EMAIL PROTECTED] wrote: Hi all, I need to extract few strings from one file and paste it to another file. snip This doesn't seem like a good job for split. The split function is good for parsing X separated records where X is either constant or simple. What you

Re: Query on pattern matching

2007-03-08 Thread Rob Dixon
Dharshana Eswaran wrote: Hi all, I need to extract few strings from one file and paste it to another file. My source file, i.e., my .h file, contains statements like: #define GMMREG_ATTACH_REQ_ID (GMMREG_PRIM_ID_BASE) /* @LOG GMMREG_ATTACH_REQ */ #define

Re: confused about a regex

2007-03-08 Thread Chas Owens
On 3/8/07, oryann9 [EMAIL PROTECTED] wrote: snip Why is $_=abc.e.i short for $_ = 'abc' . 'e' . 'i'; snip from Programming Perl 3rd Edition: bareword A word sufficient ambigious to be deemed illegal under use strict 'subs'. In the absence of that stricture, a bareword

Re: Query on pattern matching

2007-03-08 Thread John W. Krahn
Chas Owens wrote: On 3/8/07, Dharshana Eswaran [EMAIL PROTECTED] wrote: I need to extract few strings from one file and paste it to another file. snip This doesn't seem like a good job for split. The split function is good for parsing X separated records where X is either constant or

How to replace special character strings in data-elements of a XML file

2007-03-08 Thread Michael Goopta
Hi, I have an XML file which has HTML special characters (#frac12; ) etc in the contents of data elements. I need to get rid of these to enable the browser to open the file. I shall appreciate if you could guide me as to how to do it. Thanks for the help. Michael -- To unsubscribe, e-mail:

Loop while socket connection exists

2007-03-08 Thread mlist
I have a script which will create a socket connection to a host. It should loop through while the socket connection is active. The problem is that it still continues to loop even if I take down the interface on the host machine. What am I missing (no doubt somthing simple). Any help would

Re: How to replace special character strings in data-elements of a XML file

2007-03-08 Thread John W. Krahn
Michael Goopta wrote: Hi, Hello, I have an XML file which has HTML special characters (#frac12; ) etc in the contents of data elements. I need to get rid of these to enable the browser to open the file. I shall appreciate if you could guide me as to how to do it. perldoc HTML::Entities

Re: confused about a regex

2007-03-08 Thread oryann9
Yes I understand now. For some reason I missed the missing quotes in the original post and the word token came to mind. $ perl -MO=Deparse foo.plx BEGIN { $^W = 1; } use diagnostics; sub abc { use warnings; use strict 'refs'; 'abc.'; } sub e { use warnings; use strict

Re: Loop while socket connection exists

2007-03-08 Thread Steve Bertrand
You need to remove the 'my' for $whileloop within the while() statement: while ($whileloop 1) { if ($sock) { printf Socket connected\n; printf $counter\n; $counter++; sleep 2; } else { my $whileloop = 99;

Re: Loop while socket connection exists

2007-03-08 Thread Chas Owens
On 3/8/07, mlist [EMAIL PROTECTED] wrote: I have a script which will create a socket connection to a host. It should loop through while the socket connection is active. The problem is that it still continues to loop even if I take down the interface on the host machine. What am I missing (no

Re: Loop while socket connection exists

2007-03-08 Thread Jeff Pang
} else { my $whileloop = 99; } Hello, There is a scope mistaken above.You declare $whileloop at the outside of the loop,while here you re-declare another $whileloop with my.This $whileloop is different from the former one.So my $whileloop = 99 shouldn't change the

Re: Query on pattern matching

2007-03-08 Thread Dharshana Eswaran
On 3/9/07, John W. Krahn [EMAIL PROTECTED] wrote: Chas Owens wrote: On 3/8/07, Dharshana Eswaran [EMAIL PROTECTED] wrote: I need to extract few strings from one file and paste it to another file. snip This doesn't seem like a good job for split. The split function is good for parsing X