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
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
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);
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
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:
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
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:
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
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
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
$_=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
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
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
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
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
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:
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
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
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
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;
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
} 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
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
23 matches
Mail list logo