[26686] in Perl-Users-Digest
Perl-Users Digest, Issue: 8792 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Dec 24 00:05:35 2005
Date: Fri, 23 Dec 2005 21:05:04 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Fri, 23 Dec 2005 Volume: 10 Number: 8792
Today's topics:
Re: Apache and Perl in Windows <AA@AA.com>
Re: Apache and Perl in Windows <1usa@llenroc.ude.invalid>
Re: Apache and Perl in Windows <1usa@llenroc.ude.invalid>
Re: Apache and Perl in Windows <sbryce@scottbryce.com>
Re: Apache and Perl in Windows <toddrw69@excite.com>
Re: Eval not reseting <XXjbhuntxx@white-star.com>
Re: perl, v5.8.7 Windows 2003 PPM 3.3 <rvtol+news@isolution.nl>
Re: perl, v5.8.7 Windows 2003 PPM 3.3 <matthew.garrish@sympatico.ca>
Serious Perl Regular Expression deficiency? robic0
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 24 Dec 2005 02:17:06 GMT
From: Arn Anderson <AA@AA.com>
Subject: Re: Apache and Perl in Windows
Message-Id: <doib320esq@news1.newsguy.com>
I have not been able to resolve this problem, but as a note to future
programmers who might run into this problem, Perl from ActiveState simply
is not very compatible with Apache. Here is the code I ran in IIS and
Apache. Both used the same perl. Only difference is that Apache shows no
results while IIS printed out "Fresh Air is apparently jazzless today.
\n". If anyone has an answer to why IIS works and Apache does not, I
would be interested to know. But for now, I will have to use IIS.
#!c:\Perl\bin\perl.exe
use LWP 5.64;
print "Content-type: text/plain\n\n";
$url = 'http://freshair.npr.org/dayFA.cfm?todayDate=current';
$browser = LWP::UserAgent->new;
$response = $browser->get( $url );
die "Can't get $url -- ", $response->status_line
unless $response->is_success;
die "Hey, I was expecting HTML, not ", $response->content_type
unless $response->content_type eq 'text/html';
if ($response->content =~ m/jazz/i) {
print "They're talking about jazz today on Fresh Air!\n";
} else {
print "Fresh Air is apparently jazzless today.\n";
}
------------------------------
Date: Sat, 24 Dec 2005 02:58:44 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Apache and Perl in Windows
Message-Id: <Xns9735DF98BAC74asu1cornelledu@127.0.0.1>
Arn Anderson <AA@AA.com> wrote in news:dohqe70r4u@news2.newsguy.com:
> #!/usr/bin/perl -w (I replaced with #!c:\Perl\bin\perl.exe)
Why?
> use strict; (I removed this)
Why?
> use LWP::Simple; (I have use LWP::simple)
Why?
Sinan
--
A. Sinan Unur <1usa@llenroc.ude.invalid>
(reverse each component and remove .invalid for email address)
comp.lang.perl.misc guidelines on the WWW:
http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
------------------------------
Date: Sat, 24 Dec 2005 03:02:30 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Apache and Perl in Windows
Message-Id: <Xns9735E03C9702Dasu1cornelledu@127.0.0.1>
Arn Anderson <AA@AA.com> wrote in news:doib320esq@news1.newsguy.com:
> Perl from ActiveState simply is not very compatible with Apache.
How so?
Sinan
--
A. Sinan Unur <1usa@llenroc.ude.invalid>
(reverse each component and remove .invalid for email address)
comp.lang.perl.misc guidelines on the WWW:
http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
------------------------------
Date: Fri, 23 Dec 2005 21:13:16 -0700
From: Scott Bryce <sbryce@scottbryce.com>
Subject: Re: Apache and Perl in Windows
Message-Id: <M_GdnTtbH95dVzHeRVn-uA@comcast.com>
Arn Anderson wrote:
> Perl from ActiveState simply is not very compatible with Apache.
Your script works fine for me run as a CGI script on my machine.
Apache 2.0.48
ActiveState Perl 5.8.2
Windows 98SE
------------------------------
Date: Sat, 24 Dec 2005 05:02:44 GMT
From: "Todd W" <toddrw69@excite.com>
Subject: Re: Apache and Perl in Windows
Message-Id: <UD4rf.34945$BZ5.5390@newssvr13.news.prodigy.com>
"Arn Anderson" <AA@AA.com> wrote in message
news:doib320esq@news1.newsguy.com...
> I have not been able to resolve this problem, but as a note to future
> programmers who might run into this problem, Perl from ActiveState simply
> is not very compatible with Apache.
<snip>
This is not true. On a properly configured system Apache and ActiveState
perl work absolutely fine together.
Todd W.
------------------------------
Date: Fri, 23 Dec 2005 23:15:24 GMT
From: Cosmic Cruizer <XXjbhuntxx@white-star.com>
Subject: Re: Eval not reseting
Message-Id: <Xns97359B05AFDA3ccruizermydejacom@207.115.17.102>
Cosmic Cruizer <XXjbhuntxx@white-star.com> wrote in
news:Xns97357A749A404ccruizermydejacom@207.115.17.102:
> I'm trying to use the follow eval statement in a sub. The first time
> through it works fine, but the second time it fails to timeout. I'm
> trying to run it on a Solaris box with Perl v5.6.1. It looks like
> patch 11510 "eval 'format foo=' would loop indefinitely" has alrady
> been applied. Any suggestions? I'm not going to be able to upgrade the
> version of Perl on this box.
>
> eval {
> sigaction(SIGALRM, POSIX::SigAction->new("main::alrm"));
> alarm 10; # Timeout after x seconds
> @rpcinfo = `rpcinfo -p $server_address`;
> alarm 0;
> };
>
>
> Thanks
Found the problem (kind of...). Tried the script on a different Solaris box
that's running Perl v. 5.005_03. The script runs without any problems.
------------------------------
Date: Fri, 23 Dec 2005 23:48:26 +0100
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: perl, v5.8.7 Windows 2003 PPM 3.3
Message-Id: <doi2ep.180.1@news.isolution.nl>
Sisyphus schreef:
> The use of 'CPAN.pm', 'nmake' and VC++ is being cited as an
> *alternative* to ppm. You can go that way if you think it's worth the
> money.
See also:
http://msdn.microsoft.com/visualc/vctoolkit2003/
--
Affijn, Ruud
"Gewoon is een tijger."
------------------------------
Date: Fri, 23 Dec 2005 19:05:40 -0500
From: "Matt Garrish" <matthew.garrish@sympatico.ca>
Subject: Re: perl, v5.8.7 Windows 2003 PPM 3.3
Message-Id: <oh0rf.2853$1Y4.332869@news20.bellglobal.com>
"Matt Garrish" <matthew.garrish@sympatico.ca> wrote in message
news:YxTqf.2646$1Y4.299336@news20.bellglobal.com...
>
> "Sisyphus" <sisyphus1@nomail.afraid.org> wrote in message
> news:43abd710$0$17706$afc38c87@news.optusnet.com.au...
>>
>> "Pekka Siiskonen" <pekka_news@yahoo.co.uk> wrote in message
>> news:FiOqf.52$IN1.28@read3.inet.fi...
>>>
>>> So, I got the Nmake15 and installed it (to \perl\bin\) but still am
>> getting
>>> nowhere. Should I really purchase C/C++ to get the "free" Perl install
>>> modules? I must be missing something trivial -- what?
>>>
>>
>> The use of 'CPAN.pm', 'nmake' and VC++ is being cited as an *alternative*
>> to
>> ppm. You can go that way if you think it's worth the money. Personally, I
>> don't think it is worth the money. A better alternative is (imho) to
>> install
>> dmake and the MinGW compiler - both of which are freely available, and
>> both
>> of which work seamlessly with the latest build (815) of ActiveState perl.
>> If
>> you want to use dmake and MinGW with earlier ActiveState builds then you
>> should also install ExtUtils::FakeConfig.
>>
>
> This question about the ppm documentation seems to pop up every so often
> here, so I logged a bug report to AS to hopefully get them to change the
> section.
>
Just to follow up, the reponse I got is that the faq will now read "PPM
(ppm) is installed automatically with ActivePerl.", and they're going to put
the CPAN shell stuff somewhere else, so hopefully no more confusion.
Matt
------------------------------
Date: Fri, 23 Dec 2005 15:17:21 -0800
From: robic0
Subject: Serious Perl Regular Expression deficiency?
Message-Id: <va0pq1l4ft5mcoe32k45i3lgni97tdst5u@4ax.com>
I don't see a solution to this problem that
regular expressions can't exclude a string when
processing. It can exclude individual characters
fine. I started doing Perl 2 years ago and have
run into this nagging problem several times.
After extensive read on the Perl docs on re's
(especially in the last 2 days) I have come to the
conclusion that regular expressions have a serious
deficiency. This is serious because the not string
is a fundimental basic logic idea in a search from
a touted master search engine or should be.
To a degree it works with a known subset, but it
won't work to the degree shown below. This is a
serious flaw in regualar expressions!
I hope you masters can prove me wrong! I really do.
If not I would hope that the Perl authors can provide
some insight on when this construct can be fixed,
aka implemented.
Beat this code if you can (you can't). Don't look
at the code in this example, look instead at the
output.
Don't comment on any code syntax because thats not
welcome or the point.
Instead, refer you comments to the output ID's.
If you know of a way Perl regex can do this
please reply. I'm almost %99 sure Perl regex
can't do this. In fact the %1 is thrown out here
to either verify that or prove otherwise.
Thanks for your help...
print <<EOM;
\n# Serious Regular Expression deficiency,
# "not string", shown by XML comments..
# ----------------------------------------
EOM
use strict;
use warnings;
my $gabage1 = '
<big name="asdf" date="33" >
asdf
<!-- howdy folks -->
<in2>jjjj</in2>
<!-- and still more -->
asdfb
</big>
';
my $gabage2 = '
<big name="asdf" date="33" >
asdf
<!-- howdy folks %SYSTEM is down <who cares?> -->
<in2>jjjj</in2>
<!-- and still more -->
asdfb
</big>
';
my @sarrys = ($gabage1, $gabage2);
my $cnt = 1;
foreach my $xml (@sarrys) {
print "\n\n","/"x40,"\nXML $cnt:\n$xml\n";
# -------------
$_ = $xml;
print "="x40,
"\n** regex: s/<!--(.*)-->//s\n",
"-"x40,"\n";
print "id: $cnt","1\n";
while (s/<!--(.*)-->//s) { print "$1\n"; }
# -------------
$_ = $xml;
print "\n","="x40,
"\n** regex: s/<!--([^<>]*)-->//s\n",
"-"x40,"\n";
print "id: $cnt","2\n";
while (s/<!--([^<>]*)-->//s) { print "$1\n"; }
# -------------
$_ = $xml;
print "\n","="x40,
"\n** regex: s/<!--([\\w\\s]*)(?!<!--)-->//s\n",
"-"x40,"\n";
print "id: $cnt","3\n";
while (s/<!--([\w\s]*)(?!<!--)-->//s) { print "$1\n"; }
# -------------
$_ = $xml;
print "\n","="x40,
"\n** regex: s/<!--(.*)(?!<!--)-->//s\n",
"-"x40,"\n";
print "id: $cnt","4\n";
while (s/<!--(.*)(?!<!--)-->//s) { print "$1\n"; }
$cnt++;
}
__END__
C:\Drvs14\PerlMiscTest\Eraser\ESP\XMLP>perl test.pl
# Serious Regular Expression deficiency,
# "not string", shown by XML comments..
# ----------------------------------------
////////////////////////////////////////
XML 1:
<big name="asdf" date="33" >
asdf
<!-- howdy folks -->
<in2>jjjj</in2>
<!-- and still more -->
asdfb
</big>
========================================
** regex: s/<!--(.*)-->//s
----------------------------------------
id: 11
howdy folks -->
<in2>jjjj</in2>
<!-- and still more
========================================
** regex: s/<!--([^<>]*)-->//s
----------------------------------------
id: 12
howdy folks
and still more
========================================
** regex: s/<!--([\w\s]*)(?!<!--)-->//s
----------------------------------------
id: 13
howdy folks
and still more
========================================
** regex: s/<!--(.*)(?!<!--)-->//s
----------------------------------------
id: 14
howdy folks -->
<in2>jjjj</in2>
<!-- and still more
////////////////////////////////////////
XML 2:
<big name="asdf" date="33" >
asdf
<!-- howdy folks %SYSTEM is down <who cares?> -->
<in2>jjjj</in2>
<!-- and still more -->
asdfb
</big>
========================================
** regex: s/<!--(.*)-->//s
----------------------------------------
id: 21
howdy folks %SYSTEM is down <who cares?> -->
<in2>jjjj</in2>
<!-- and still more
========================================
** regex: s/<!--([^<>]*)-->//s
----------------------------------------
id: 22
and still more
========================================
** regex: s/<!--([\w\s]*)(?!<!--)-->//s
----------------------------------------
id: 23
and still more
========================================
** regex: s/<!--(.*)(?!<!--)-->//s
----------------------------------------
id: 24
howdy folks %SYSTEM is down <who cares?> -->
<in2>jjjj</in2>
<!-- and still more
------------------------------
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.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
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 8792
***************************************