[23324] in Perl-Users-Digest
Perl-Users Digest, Issue: 5544 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Sep 22 18:10:41 2003
Date: Mon, 22 Sep 2003 15:10:16 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Mon, 22 Sep 2003 Volume: 10 Number: 5544
Today's topics:
Re: Operator Precedence <REMOVEsdnCAPS@comcast.net>
Re: OT: WebGUI, any reviews? <tore@aursand.no>
Packing/unpacking (Julie)
Re: Packing/unpacking (Anno Siegel)
Re: Packing/unpacking <syscjm@gwu.edu>
PPM problems <x12code-del@del-yahoo.com>
Re: reading STDIN with Perl on Linux / Apache <me@verizon.invalid>
Re: reading STDIN with Perl on Linux / Apache <REMOVEsdnCAPS@comcast.net>
Re: simple server <tore@aursand.no>
some proxies post and some won't with lwp (Robert)
Re: some proxies post and some won't with lwp <NOSPAM@bigpond.com>
Re: splitting lines <notavailable@nospamplease.com>
Re: splitting lines <tcurrey@no.no.no.i.said.no>
Re: splitting lines <ebohlman@earthlink.net>
Re: string length? <tcurrey@no.no.no.i.said.no>
Re: string length? <syscjm@gwu.edu>
Re: string length? <abigail@abigail.nl>
Re: string length? <tore@aursand.no>
Stupid perl regexp question (G Klinedinst)
Using variables in RegEx statements? <NoSpamPlease@bellsouth.net>
Re: Using variables in RegEx statements? <abigail@abigail.nl>
Re: Using variables in RegEx statements? <uri@stemsystems.com>
Re: WWW::Mechanize click() returns "Unexpected field va <bart.lateur@pandora.be>
Re: <bwalton@rochester.rr.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 22 Sep 2003 14:53:00 -0500
From: "Eric J. Roode" <REMOVEsdnCAPS@comcast.net>
Subject: Re: Operator Precedence
Message-Id: <Xns93FEA1951FDA9sdn.comcast@206.127.4.25>
-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1
mjeff1@twcny.rr.com (Jeff Mott) wrote in news:970676ed.0309212353.1949ae95
@posting.google.com:
> Since the assignment operator has higher precedence than comma,
> shouldn't the following line
>
> my $s = substr "foo", 0, 1;
>
> technically be interpreted as
>
> (my $s = substr "foo"), 0, 1;
>
> ?
You would think so, wouldn't you?
However, the commas in the above expressions are not comma operators, they
are operator argument-separator commas.
How to tell the difference? 1. perldoc perlop. 2. experience. :-)
- --
Eric
$_ = reverse sort $ /. r , qw p ekca lre uJ reh
ts p , map $ _. $ " , qw e p h tona e and print
-----BEGIN xxx SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>
iQA/AwUBP29TFWPeouIeTNHoEQIrqwCg0r3dUNkGBRiwOSIUdvf2+wEd7XEAnRg+
Lsk8bxH23sGyP1THRokvRVEX
=Igzx
-----END PGP SIGNATURE-----
------------------------------
Date: Mon, 22 Sep 2003 23:01:04 +0200
From: Tore Aursand <tore@aursand.no>
Subject: Re: OT: WebGUI, any reviews?
Message-Id: <pan.2003.09.18.09.31.34.934858@aursand.no>
On Wed, 17 Sep 2003 07:24:33 -0700, Prabh wrote:
> I'm trying to find any reviews for the open-source , content
> management system, WebGUI and am unable to find many.
I've seen a few of them, 'cause I'm developing my own CMS system. None of
those I've checked filled my requirements. Neither did WebGUI.
On the other hand: The best open-sourced CMS system (written in Perl)
I've had a look at is Bricolage. That's my opinion.
> [ About WebGUI ]
> 1) How safe is it?
Don't know. I know it supported a set of different authentication
mechanisms, though, as cookies, LDAP and SMB (as far as I remember).
> 2) Do I need to send my docs off-site?
Don't know what you mean...?
> 3) How different is it from Xerox's DocUShare.
No idea. Never tried DocUShare.
> 4) Your general experience with it, would you recommend it?
I would recommend Bricolage. WebGUI was _way_ to slow, even when running
under mod_perl.
One last thing: One important thing for me, is that I can run the CMS
system for many users (ie. ASP style). I could have many customers who'd
want the same CMS system, and I needed to run all of them on the same
server.
Most CMS systems (I've looked at) don't have this possibility. The CMS
system can only be run "as one" on one server. I could maybe achieve a
different setup by configuring virtual hosts in Apache, but I don't think
that should be necessary.
--
Tore Aursand <tore@aursand.no>
"You know the world is going crazy when the best rapper is white, the best
golfer is black, France is accusing US of arrogance and Germany doesn't
want to go to war."
------------------------------
Date: 22 Sep 2003 14:15:22 -0700
From: julietoy@pennswoods.net (Julie)
Subject: Packing/unpacking
Message-Id: <51fdeb76.0309221315.5f78df38@posting.google.com>
I am trying to take a number 64001072 and get this value into a 3-byte binary value.
I have tried:
$val = 640001072;
$value = pack("l",$val);
($s1, $s2, $s3, $s4) = unpack("CCCC",$value);
$new_value = pack("CCC",$s3,$s2,$s1);
this works for other values, but does not seem to work for this value.
Any suggestions???
Thanks,
Julie
------------------------------
Date: 22 Sep 2003 21:24:32 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Packing/unpacking
Message-Id: <bknpag$fs4$2@mamenchi.zrz.TU-Berlin.DE>
Julie <julietoy@pennswoods.net> wrote in comp.lang.perl.misc:
> I am trying to take a number 64001072 and get this value into a 3-byte
> binary value.
>
> I have tried:
>
> $val = 640001072;
> $value = pack("l",$val);
> ($s1, $s2, $s3, $s4) = unpack("CCCC",$value);
> $new_value = pack("CCC",$s3,$s2,$s1);
>
> this works for other values, but does not seem to work for this value.
>
> Any suggestions???
No. 64001072 > 2**24. It won't fit into three bytes, whichever way you
turn it.
Anno
------------------------------
Date: Mon, 22 Sep 2003 17:34:27 -0400
From: Chris Mattern <syscjm@gwu.edu>
Subject: Re: Packing/unpacking
Message-Id: <3F6F6AE3.4050401@gwu.edu>
Julie wrote:
> I am trying to take a number 64001072 and get this value into a 3-byte binary value.
>
Well, that'll be a neat trick if you can manage it.
The number requires four bytes to hold it.
Chris Mattern
------------------------------
Date: Mon, 22 Sep 2003 13:17:16 -0500
From: David McDivitt <x12code-del@del-yahoo.com>
Subject: PPM problems
Message-Id: <u4fumvkmgbspmvlltudrugtt2vvgmp9heq@4ax.com>
I read what I could find about package importing prior to posting. When I
typed:
ppm install DBI
I received an error and what I read indicated it was because of our
firewall. I displayed connection properties in internet explorer and found
the following:
a03.zzzz.zzzz.zz.us:8080
The following environment variable was added to Win2000:
set HTTP_PROXY=a03.zzzz.zzzz.zz.us:8080
Now I the following error with PPM:
Error: No valid repositories: Error: 501 Protocol scheme
'a03.zzzz.zzzz.zz.us' is not supported Error: 501 Protocol
scheme 'a03.zzzz.zzzz.zz.us' is not supported
DBI.zip was downloaded from ActivePerl and unzipped into a folder honoring
folder names in the zip file. When I type the following:
ppm install DBI.ppd
I still get the internet error above. I would like to know two things.
First, how do I get rid of the internet error so I don't have to download
stuff. Second, why is it trying to use the internet if I invoked PPM from
within the directory I unzipped the files. Thanks
------------------------------
Date: Mon, 22 Sep 2003 18:10:48 GMT
From: "dw" <me@verizon.invalid>
Subject: Re: reading STDIN with Perl on Linux / Apache
Message-Id: <IWGbb.14322$zA2.6004@nwrddc02.gnilink.net>
> > use this:
> > my $parameter = param('name_of_the_parameter_you_want');
> > print "parameter value is:$parameter";
>
> Well, as it turns out, it appears to work for some reason!
> What I don't understand is why.
> I don't even have to read the STDIN such as:
> read(STDIN, $temp, $ENV{'CONTENT_LENGTH'});
>
> So does Apache or something else automatically assign the STDIN parameters
> to param?
> I guess it's not that important if it works!
>
CGI.pm does that for you. If you submit the form using GET, it gets its
data from the URL. If you submit using POST, it gets its data from STDIN.
------------------------------
Date: Mon, 22 Sep 2003 14:34:32 -0500
From: "Eric J. Roode" <REMOVEsdnCAPS@comcast.net>
Subject: Re: reading STDIN with Perl on Linux / Apache
Message-Id: <Xns93FE9E736322Fsdn.comcast@206.127.4.25>
-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1
"John Smith" <someone@microsoft.com> wrote in
news:PLDbb.13752$Ej.1997190@ursa-nb00s0.nbnet.nb.ca:
> I hope I am not posting this to the wrong group, as it deals with HTML
> and PERL.
>
>
> I had a script that read information from the QUERY_STRING environment
> variable, such as:
> $temp=$ENV{'QUERY_STRING'};
>
> It received this information from an HTML document that used the GET
> method to send its form data to the perl script, such as:
> <FORM method="get" action="/cgi-bin/script.pl">
>
> This worked fine, but the form data ends up as part of the URL, such
> as:
> http://domainname/cgi-bin/script.pl?year=2003&pwd=12345
>
> This would not be too bad except that part of the information sent to
> the perl script is a password.
> I would prefer that this information not be part of the URL.
Why not? It's not really any less secure than transmitting it via POST
method.
> Here is a look at part of my script.
>
> #!/usr/bin/perl
>
> use CGI qw(:standard);
> my $query = new CGI;
> print"Content-type: text/html\n\n";
>
> $cl=$ENV{'CONTENT_LENGTH'};
> if ($cl > 0)
> {
> read(STDIN, $temp, $cl); # Read POST data from
> STDIN print" 11.. temp = $temp <br>\n";
> }
> else
> {
> $temp=$ENV{'QUERY_STRING'}; # Get info submitted
> from
> HTML form
> print" 12.. temp = $temp <br>\n";
> }
Why go to all this work? CGI.pm does all of this for you, and more.
You're already using CGI.pm. Just ask it what the query parameters are.
Don't parse it all out yourself.
- --
Eric
$_ = reverse sort $ /. r , qw p ekca lre uJ reh
ts p , map $ _. $ " , qw e p h tona e and print
-----BEGIN xxx SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>
iQA/AwUBP29OxGPeouIeTNHoEQLG8gCg/unzlxZu6KEfiO89fLwUSB5jMN4An1Ix
zePkKlXie2cFZIuwH1zXXmlK
=ykXY
-----END PGP SIGNATURE-----
------------------------------
Date: Mon, 22 Sep 2003 23:00:56 +0200
From: Tore Aursand <tore@aursand.no>
Subject: Re: simple server
Message-Id: <pan.2003.09.19.16.46.43.450621@aursand.no>
On Fri, 19 Sep 2003 16:10:53 +0000, D Borland wrote:
> my perl question was how do i do that i perl, not with Apache, et cetera, or
> another server. I was wondering if perl has an ability to do that.
First of all, don't top-post. Secondly, you asked if there is "any way
with perl for me to create a simple server". Seems to me like you want to
write a web server in Perl. Don't do that. Use Apache (for example),
instead.
--
Tore Aursand <tore@aursand.no>
------------------------------
Date: 22 Sep 2003 13:52:01 -0700
From: robert@nrc.net (Robert)
Subject: some proxies post and some won't with lwp
Message-Id: <22d0e990.0309221252.60c0379c@posting.google.com>
Hi,
I have a problem posting through proxies that only happens about half
the time, using different proxies.
Can somebody tell me what would cause some proxies to post just fine
and some to spit back this? Thanks in advance.
Code: 411
Message: Length Required
Date: Mon, 22 Sep 2003 20:25:01 GMT
Server: squid/2.5.STABLE3-20030721
Content-Length: 1557
Content-Type: text/html
Content-Type: text/html; charset=iso-8859-1
Expires: Mon, 22 Sep 2003 20:25:01 GMT
Client-Date: Mon, 22 Sep 2003 20:36:35 GMT
Client-Response-Num: 1
Mime-Version: 1.0
Proxy-Connection: close
Title: ERROR: The requested URL could not be retrieved
X-Cache: MISS from proxy.ecopy.com.ph
X-Squid-Error: ERR_INVALID_REQ 0
------------------------------
Date: Tue, 23 Sep 2003 07:09:00 +1000
From: "Gregory Toomey" <NOSPAM@bigpond.com>
Subject: Re: some proxies post and some won't with lwp
Message-Id: <bknodd$3k5td$1@ID-202028.news.uni-berlin.de>
"Robert" <robert@nrc.net> wrote in message
news:22d0e990.0309221252.60c0379c@posting.google.com...
> Hi,
> I have a problem posting through proxies that only happens about half
> the time, using different proxies.
Havent got a clue. Try a newsgroup that deals with proxies. I only
understand Perl.
gtoomey
------------------------------
Date: Mon, 22 Sep 2003 19:03:41 +0100
From: "D Borland" <notavailable@nospamplease.com>
Subject: Re: splitting lines
Message-Id: <DRGbb.7013$Ne.2788082@newsfep2-win.server.ntli.net>
"Bigus" <bigus_34@yahoo.co.uk> wrote in message
news:QbGbb.1792$jJ3.27457@newsfep4-glfd.server.ntli.net...
>
> "Bob Smith" <bobsmith@jippii.fi> wrote in message
> news:3F6F2625.B949AE9@jippii.fi...
> > hi
> > how to split text into lines?
> > I have in a db whitespace delimited words forming chapters in one field,
> > and I want to nicely put it on the page with max 30 or so characters per
> > paragraph, after that line breaks should occur,
>
> I take it you mean 30 characters per line rather than paragraph?
>
> If so, try something like this:
>
> @lines = $dbtext =~ /(.{30}\S*)/g;
> foreach(@lines)
> {
> $_ =~ s/^\s+//;
can't that be typed just as s/^\s+//; not $_ =~ s^\s+//;
> print "$_\n";
> }
>
> Bigus
>
>
------------------------------
Date: Mon, 22 Sep 2003 12:03:59 -0700
From: "Trent Curry" <tcurrey@no.no.no.i.said.no>
Subject: Re: splitting lines
Message-Id: <bknh7a$rtb$1@news.astound.net>
D Borland wrote:
> "Bigus" <bigus_34@yahoo.co.uk> wrote in message
> news:QbGbb.1792$jJ3.27457@newsfep4-glfd.server.ntli.net...
>>
>> "Bob Smith" <bobsmith@jippii.fi> wrote in message
>> news:3F6F2625.B949AE9@jippii.fi...
>>> hi
>>> how to split text into lines?
>>> I have in a db whitespace delimited words forming chapters in one
>>> field, and I want to nicely put it on the page with max 30 or so
>>> characters per paragraph, after that line breaks should occur,
>>
>> I take it you mean 30 characters per line rather than paragraph?
>>
>> If so, try something like this:
>>
>> @lines = $dbtext =~ /(.{30}\S*)/g;
>> foreach(@lines)
>> {
>> $_ =~ s/^\s+//;
>
> can't that be typed just as s/^\s+//; not $_ =~ s^\s+//;
Yes it can, since s/ (a substitution op) with no lhs implies using $_;
--
Trent Curry
perl -e
'($s=qq/e29716770256864702379602c6275605/)=~s!([0-9a-f]{2})!pack("h2",$1)!eg
;print(reverse("$s")."\n");'
------------------------------
Date: 22 Sep 2003 21:03:43 GMT
From: Eric Bohlman <ebohlman@earthlink.net>
Subject: Re: splitting lines
Message-Id: <Xns93FEA4DF1A490ebohlmanomsdevcom@130.133.1.4>
Bob Smith <bobsmith@jippii.fi> wrote in news:3F6F2625.B949AE9@jippii.fi:
> hi
> how to split text into lines?
> I have in a db whitespace delimited words forming chapters in one field,
> and I want to nicely put it on the page with max 30 or so characters per
> paragraph, after that line breaks should occur,
> but I can't figure out the regexp for doing it,
You're better off using Text::Format, or Text::Autoformat, or a related
module for this rather than trying to create a regexp. The authors of
those modules have already dealt with a number of "gotchas" that occur in
text formatting.
------------------------------
Date: Mon, 22 Sep 2003 11:59:51 -0700
From: "Trent Curry" <tcurrey@no.no.no.i.said.no>
Subject: Re: string length?
Message-Id: <bkngvj$rt7$1@news.astound.net>
Chris Mattern wrote:
> Abigail wrote:
>> Bob Smith (bobsmith@jippii.fi) wrote on MMMDCLXXIV September
>> MCMXCIII in <URL:news:3F6F0C2D.20514EE8@jippii.fi>:
>> '' how do I get the string length of a string?
>>
>>
>> That's why Perl has the handy chop function!
>>
>> $str = "I want to know the length";
>> $length = 0;
>> while ($str ne "") {
>> $tmp = $length + 1;
>> chop $str;
>> $length = $tmp;
>> }
>>
>>
> Now, is that a nice thing to do to a newbie, Abigail?
>
> Chris Mattern
I don't think there was any reason to do that at all. It's just confusing a
new person even more and could just result in him coming back whining about
why the code isn't working. If you don't like newbie questions why respond
to them?
--
Trent Curry
perl -e
'($s=qq/e29716770256864702379602c6275605/)=~s!([0-9a-f]{2})!pack("h2",$1)!eg
;print(reverse("$s")."\n");'
------------------------------
Date: Mon, 22 Sep 2003 15:22:07 -0400
From: Chris Mattern <syscjm@gwu.edu>
Subject: Re: string length?
Message-Id: <3F6F4BDF.9000306@gwu.edu>
Trent Curry wrote:
> Chris Mattern wrote:
>
>>Abigail wrote:
>>
>>>Bob Smith (bobsmith@jippii.fi) wrote on MMMDCLXXIV September
>>>MCMXCIII in <URL:news:3F6F0C2D.20514EE8@jippii.fi>:
>>>'' how do I get the string length of a string?
>>>
>>>
>>>That's why Perl has the handy chop function!
>>>
>>> $str = "I want to know the length";
>>> $length = 0;
>>> while ($str ne "") {
>>> $tmp = $length + 1;
>>> chop $str;
>>> $length = $tmp;
>>> }
>>>
>>>
>>
>>Now, is that a nice thing to do to a newbie, Abigail?
>>
>> Chris Mattern
>
>
> I don't think there was any reason to do that at all. It's just confusing a
> new person even more and could just result in him coming back whining about
> why the code isn't working.
Not work? What in the above code does not work? It's horribly ugly and
incredibly ludicrous, but it does *work* (it does destroy the source string,
but then the original poster never said he needed it preserved...).
> If you don't like newbie questions why respond
> to them?
>
Even newbies should have read the FAQ, and thus know how to read the
basic documentation. That may have been a bit harsh, though.
Chris Mattern
------------------------------
Date: 22 Sep 2003 20:02:07 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: string length?
Message-Id: <slrnbmul9u.sig.abigail@alexandra.abigail.nl>
Chris Mattern (syscjm@gwu.edu) wrote on MMMDCLXXIV September MCMXCIII in
<URL:news:3F6F1CCA.4040702@gwu.edu>:
:: Abigail wrote:
:: > Bob Smith (bobsmith@jippii.fi) wrote on MMMDCLXXIV September MCMXCIII in
:: > <URL:news:3F6F0C2D.20514EE8@jippii.fi>:
:: > '' how do I get the string length of a string?
:: >
:: >
:: > That's why Perl has the handy chop function!
:: >
:: > $str = "I want to know the length";
:: > $length = 0;
:: > while ($str ne "") {
:: > $tmp = $length + 1;
:: > chop $str;
:: > $length = $tmp;
:: > }
:: >
:: >
:: Now, is that a nice thing to do to a newbie, Abigail?
Well, I'd considered roasting him over a fire, and feeding him to
my dog, but my dog doesn't like Bobs. (The dog is a sysadmin).
Abigail
--
sub J::FETCH{Just }$_.='print+"@{[map';sub J::TIESCALAR{bless\my$J,J}
sub A::FETCH{Another}$_.='{tie my($x),$';sub A::TIESCALAR{bless\my$A,A}
sub P::FETCH{Perl }$_.='_;$x}qw/J A P';sub P::TIESCALAR{bless\my$P,P}
sub H::FETCH{Hacker }$_.=' H/]}\n"';eval;sub H::TIESCALAR{bless\my$H,H}
------------------------------
Date: Mon, 22 Sep 2003 23:01:00 +0200
From: Tore Aursand <tore@aursand.no>
Subject: Re: string length?
Message-Id: <pan.2003.09.22.15.03.51.115192@aursand.no>
On Mon, 22 Sep 2003 10:01:48 -0500, J. Gleixner wrote:
>> how do I get the string length of a string?
> perldoc -f length
Actually, that gives you the _documentation_ for the 'length' function. :-)
The correct answer is of course:
my $string = 'this is a string';
my $length = length( $string );
<g>
--
Tore Aursand <tore@aursand.no>
"You know the world is going crazy when the best rapper is white, the best
golfer is black, France is accusing US of arrogance and Germany doesn't
want to go to war."
------------------------------
Date: 22 Sep 2003 15:04:55 -0700
From: g_klinedinst@hotmail.com (G Klinedinst)
Subject: Stupid perl regexp question
Message-Id: <168f035a.0309221404.769f4994@posting.google.com>
This is a really stupid regexp question but can someone please explain
to me why this doesn't work:
if( m/\/{1}/ ) { print $_; }
I want to match only those lines which contain 1 and only 1 "/"
character. My understanding is that a forward slash needs escaped or
else it would signal the end of the regexp, the {1} indicates to match
one and only one time. I have seen examples such as:
$string =~ m/^\S{1,8}\.\S{0,3}/;
which clearly show the syntax of both escaping and repetition and I
can't see for the life of me how mine is different, except that I
don't care about the pattern matching at the beginning of the string.
Output is returning lines that have 1 or more "/" chars. TIA for any
help. BTW, please do not reply with suggestions to use grep, or
sed/awk, or python, or C, or Lisp, or Smalltalk or any other languages
or techniques. I want to use Perl for what I am doing.
G. Klinedinst
------------------------------
Date: Mon, 22 Sep 2003 17:23:16 -0400
From: "Rodney" <NoSpamPlease@bellsouth.net>
Subject: Using variables in RegEx statements?
Message-Id: <aIJbb.10555$jO.2981@bignews3.bellsouth.net>
I would like to do something like:
if ($SubIP_1 =~ /$SubIP[0]\.$SubIP[1]\.\d+\.\d+/)
But apparently, I can not use variables in the RegEx statement.
Can someone explain this to me?
Thanks,
--
...
`·.¸¸.·´¯`·.¸¸.·´¯`·-> rodney
------------------------------
Date: 22 Sep 2003 21:30:42 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: Using variables in RegEx statements?
Message-Id: <slrnbmuqg2.sig.abigail@alexandra.abigail.nl>
Rodney (NoSpamPlease@bellsouth.net) wrote on MMMDCLXXIV September
MCMXCIII in <URL:news:aIJbb.10555$jO.2981@bignews3.bellsouth.net>:
!! I would like to do something like:
!!
!! if ($SubIP_1 =~ /$SubIP[0]\.$SubIP[1]\.\d+\.\d+/)
!!
!! But apparently, I can not use variables in the RegEx statement.
!!
!! Can someone explain this to me?
You must be doing something wrong, because I can:
#!/usr/bin/perl
use strict;
use warnings;
no warnings qw /syntax/;
my @SubIP = qw /192 168/;
my $SubIP_1 = '192.168.0.0';
if ($SubIP_1 =~ /$SubIP[0]\.$SubIP[1]\.\d+\.\d+/) {
print "Found!\n";
}
__END__
Found!
Abigail
--
# Count the number of lines; code doesn't match \w. Linux specific.
()=<>;$!=$=;($:,$,,$;,$")=$!=~/.(.)..(.)(.)..(.)/;
$;++;$*++;$;++;$*++;$;++;`$:$,$;$" $. >&$*`;
------------------------------
Date: Mon, 22 Sep 2003 21:38:43 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Using variables in RegEx statements?
Message-Id: <x7wuc0ijvg.fsf@mail.sysarch.com>
>>>>> "R" == Rodney <NoSpamPlease@bellsouth.net> writes:
R> I would like to do something like:
R> if ($SubIP_1 =~ /$SubIP[0]\.$SubIP[1]\.\d+\.\d+/)
R> But apparently, I can not use variables in the RegEx statement.
how did you derive that conclusion?
R> Can someone explain this to me?
can you show what data is in the variables? there is no way to debug it
given that one line of code.
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
Damian Conway Class in Boston - Sept 2003 -- http://www.stemsystems.com/class
------------------------------
Date: Mon, 22 Sep 2003 20:31:41 GMT
From: Bart Lateur <bart.lateur@pandora.be>
Subject: Re: WWW::Mechanize click() returns "Unexpected field value"
Message-Id: <timumvsta2kijo78nnk9tfei2eaqhnsk1o@4ax.com>
Timur Tabi wrote:
> The WWW::Mechanize get()
>command works just fine. It's the click() command that doesn't work.
First off, I will say that I find that WWW::Mechanize is a very hard
module to debug scripts for. Far too hard.
I could be wrong, but this message:
Unexpected field value
says to me that you don't seem to have a form selected. In other words:
I doubt if there's a form in that page. Try
$agent->form(1);
before calling field(). See if it complains. If it doesn't, you should
try to get a list of fields that are in that form, though I'm not sure
how you can do that.
I hate that module. Well, some things about it.
--
Bart.
------------------------------
Date: Sat, 19 Jul 2003 01:59:56 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re:
Message-Id: <3F18A600.3040306@rochester.rr.com>
Ron wrote:
> Tried this code get a server 500 error.
>
> Anyone know what's wrong with it?
>
> if $DayName eq "Select a Day" or $RouteName eq "Select A Route") {
(---^
> dienice("Please use the back button on your browser to fill out the Day
> & Route fields.");
> }
...
> Ron
...
--
Bob Walton
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V10 Issue 5544
***************************************