[26684] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 8791 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Dec 23 18:05:23 2005

Date: Fri, 23 Dec 2005 15:05:05 -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: 8791

Today's topics:
        Apache and Perl in Windows <AA@AA.com>
    Re: Apache and Perl in Windows <no@email.com>
    Re: Apache and Perl in Windows <AA@AA.com>
        Eval not reseting <XXjbhuntxx@white-star.com>
    Re: perl, v5.8.7 Windows 2003 PPM 3.3  <sisyphus1@nomail.afraid.org>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: 23 Dec 2005 19:29:35 GMT
From: Arn Anderson <AA@AA.com>
Subject: Apache and Perl in Windows
Message-Id: <dohj6v019hm@news3.newsguy.com>

Hi and Merry Christmas. I am having a problem. The cgi scripts execute, 
but the output is empty. I am studying a spider book that uses Perl so I 
download perl and Apache, then uncomment out the lines in the web.xml 
file in apache and rename the jar files in the server directory. Then I 
launch apache and run my script using an HTML file. The script executes, 
but I don't see any results. Perl works fine separately and so does 
Apache. But together, they don't. Here is the source code for the 2 
files. I think this has to do with permissions, but when I installed 
Apache, I used the same account and password as my Windows username and I 
am administrator. I am out of ideas. If anyone knows what is going wrong, 
I would appreciate the help. Thank you.

<HTML>
<HEAD>
<TITLE>Environment Variables 
   using GET</TITLE>
</HEAD>
<BODY>
<FORM ACTION="cgi-bin/exp.cgi" METHOD="GET">
Press submit for a list of environment variables. <BR>

First Name: <input type=
   "text" name="fname" size=
   30><p>
Last Name: <input type="text" 
   name="lname" size=30><p>
<input type="submit">
</form>

<FORM>
</BODY>
</HTML>




#!c:\Perl\bin\perl.exe
use CGI qw(:all); 
use Strict;
use LPW::Simple;

print "Content-type: text/plain\n\n";

foreach $var (sort keys %ENV) {
   print "$var=\"$ENV{$var}\"\n";
}

@values = split(/&/,$ENV{'QUERY_STRING'});
foreach $i (@values) {
   ($varname, $mydata) = split(/=/,$i);
   print "$varname = $mydata\n";
}


------------------------------

Date: Fri, 23 Dec 2005 20:24:17 +0000
From: Brian Wakem <no@email.com>
Subject: Re: Apache and Perl in Windows
Message-Id: <4134niF1d58f5U1@individual.net>

Arn Anderson wrote:

> Hi and Merry Christmas. I am having a problem. The cgi scripts execute,
> but the output is empty. I am studying a spider book that uses Perl so I
> download perl and Apache, then uncomment out the lines in the web.xml
> file in apache and rename the jar files in the server directory. Then I
> launch apache and run my script using an HTML file. The script executes,
> but I don't see any results. Perl works fine separately and so does
> Apache. But together, they don't. Here is the source code for the 2
> files. I think this has to do with permissions, but when I installed
> Apache, I used the same account and password as my Windows username and I
> am administrator. I am out of ideas. If anyone knows what is going wrong,
> I would appreciate the help. Thank you.
> 
> <HTML>
> <HEAD>
> <TITLE>Environment Variables
>    using GET</TITLE>
> </HEAD>
> <BODY>
> <FORM ACTION="cgi-bin/exp.cgi" METHOD="GET">
> Press submit for a list of environment variables. <BR>
> 
> First Name: <input type=
>    "text" name="fname" size=
>    30><p>
> Last Name: <input type="text"
>    name="lname" size=30><p>
> <input type="submit">
> </form>
> 
> <FORM>
> </BODY>
> </HTML>
> 
> 
> 
> 
> #!c:\Perl\bin\perl.exe
> use CGI qw(:all);
> use Strict;


Should be lower case s.


> use LPW::Simple;


I don't believe this module exists, so your code does not compile.


> print "Content-type: text/plain\n\n";


Why use the CGI module and print your own headers?


> foreach $var (sort keys %ENV) {


Global symbol "$var" requires explicit package name at ....


>    print "$var=\"$ENV{$var}\"\n";
> }
> 
> @values = split(/&/,$ENV{'QUERY_STRING'});


Global symbol "@var" requires explicit package name at ...

There are many more errors.  I can't be bothered to point them all out. 
Needless to say the code does not compile.


-- 
Brian Wakem
Email: http://homepage.ntlworld.com/b.wakem/myemail.png


------------------------------

Date: 23 Dec 2005 21:32:55 GMT
From: Arn Anderson <AA@AA.com>
Subject: Re: Apache and Perl in Windows
Message-Id: <dohqe70r4u@news2.newsguy.com>

Thanks all for the posts. Here's one example that came straight from the 
Oreilly Spidering Hacks book that will not work in Windows with Apache. I 
have no clue as to why because it will work fine from the command line in 
ActiveState perl. And ActiveState has the LWP module already installed. 
Does ActiveState work better in IIS? I prefer Apache, but I've spent 2 
days just trying to figure this out. Is ActiveState the recommended 
version of Perl for Windows that you experts recommend?

#!/usr/bin/perl -w    	    (I replaced with #!c:\Perl\bin\perl.exe)
use strict;    	    	    (I removed this)
use LWP::Simple;    	    (I have use LWP::simple)


# Just an example: the URL for the most recent /Fresh Air/ show 
my $url = 'http://freshair.npr.org/dayFA.cfm?todayDate=current';

my $content = get($url);
die "Couldn't get $url" unless defined $content;

# Do things with $content:
if ($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: Fri, 23 Dec 2005 20:03:19 GMT
From: Cosmic Cruizer <XXjbhuntxx@white-star.com>
Subject: Eval not reseting
Message-Id: <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


------------------------------

Date: Sat, 24 Dec 2005 09:43:10 +1100
From: "Sisyphus" <sisyphus1@nomail.afraid.org>
Subject: Re: perl, v5.8.7 Windows 2003 PPM 3.3 
Message-Id: <43ac7de2$0$15404$afc38c87@news.optusnet.com.au>


"Sisyphus" <sisyphus1@nomail.afraid.org> wrote in message

> I've just posted
> to an ActiveState mailing list about this particular problem. If I get an
> answer, I'll post a follow-up

They're saying that it's a load-related server problem and that they're
trying to fix it.

Cheers,
Rob




------------------------------

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 8791
***************************************


home help back first fref pref prev next nref lref last post