[23465] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5679 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Oct 18 21:06:00 2003

Date: Sat, 18 Oct 2003 18:05:07 -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           Sat, 18 Oct 2003     Volume: 10 Number: 5679

Today's topics:
        CGI::Push <perl@my-header.org>
        finding text-segment in a HTTP::Element tree <nan@voulauépa.com>
    Re: finding text-segment in a HTTP::Element tree <kuujinbo@hotmail.com>
        Hair-pulling Switch bug ? <grootw@cs.utwente.nl>
        how to keep database connection persistent <dragon@china.com>
    Re: how to keep database connection persistent <REMOVEsdnCAPS@comcast.net>
    Re: how to keep database connection persistent <dragon@china.com>
        how would i handle this? (The Mosquito ScriptKiddiot)
        OT: IT Champions <perl@my-header.org>
        Perl 'system' Creates Program That Dies When First C Pr (Christopher M. Lusardi)
    Re: Perl 'system' Creates Program That Dies When First  <invalid-email@rochester.rr.com>
        Perl security guru needed for a quick, 2 hr, job. (RMallonday)
    Re: Perl security guru needed for a quick, 2 hr, job. <junkto@tm.net.my>
    Re: Perl security guru needed for a quick, 2 hr, job. (RMallonday)
    Re: Perl security guru needed for a quick, 2 hr, job. <dha@panix.com>
    Re: Perl security guru needed for a quick, 2 hr, job. (Tad McClellan)
        Prove this wrong!!!! <webmaster@kmaproductions.com>
    Re: regex @a = m /  |  /g and captures? (Bill)
    Re: regex @a = m /  |  /g and captures? (Quantum Mechanic)
    Re: regex @a = m /  |  /g and captures? (Bill)
    Re: Scope of \Q, \L, \U, etc. <edi@agharta.de>
    Re: TCP close_wait problem <wherrera@lynxview.com>
        Use perl in apache without #!/path/to/perl (Kostas Hatzikokolakis)
    Re: Use perl in apache without #!/path/to/perl <jwillmore@remove.adelphia.net>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Sat, 18 Oct 2003 17:47:46 +0200
From: Matija Papec <perl@my-header.org>
Subject: CGI::Push
Message-Id: <82o2pvg92i376hfg112q8flf4kcgeodb3k@4ax.com>


Is it possible to determine when the client terminates open connection? I
see CGI::Push shows example which only use counter to decide when to stop
serving pages.

tia


-- 
Matija


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

Date: Sat, 18 Oct 2003 08:19:33 +0200
From: "Arthur B." <nan@voulauépa.com>
Subject: finding text-segment in a HTTP::Element tree
Message-Id: <bmrbcm$ipc$1@news.polytechnique.fr>

Hello,
I found many exemples on how to look for specific tags using the      
'look-down'. However I don't see how to write properly, using look-down,
something that would call my sub on each text-segment ( or say call my sub
and let the sub check it is dealing with a text-segment )

Tahnk you if anyone can help


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

Date: Sat, 18 Oct 2003 16:24:09 +0900
From: ko <kuujinbo@hotmail.com>
Subject: Re: finding text-segment in a HTTP::Element tree
Message-Id: <bmqpq8$qdd$1@pin3.tky.plala.or.jp>

Arthur B. wrote:
> Hello,
> I found many exemples on how to look for specific tags using the      
> 'look-down'. However I don't see how to write properly, using look-down,
> something that would call my sub on each text-segment ( or say call my sub
> and let the sub check it is dealing with a text-segment )
> 
> Tahnk you if anyone can help

I could be wrong, but I don't think there is a HTTP::Element module on 
CPAN (at least it doesn't show up in the first 100 doing a search). 
HTML::Element has a look_down method. Is this what you are using?

What exactly are you trying to do, and what code have you tried so far?

keith



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

Date: Sat, 18 Oct 2003 14:53:47 +0200
From: "Willem" <grootw@cs.utwente.nl>
Subject: Hair-pulling Switch bug ?
Message-Id: <bmrd4q$76b$1@netlx020.civ.utwente.nl>

Hello! What is going wrong in the following example?
==================================
use IO::Socket;
use Switch;

$handle = IO::Socket::INET->new("smtp.utwente.nl:25")
  or die "can't connect: $!";

while (defined ($line = <$handle>)) {
    print STDOUT $line;
    last;
}

# switch
==================================
This spits out:
IO::Socket::INET=GLOB(0x8341060)

If I remove the last "# switch\n" line, it works okay. Why does Switch mess
up IO::Socket and why isn't that comment ignored?

Perl v5.8.0
Switch v2.09

Thanks !
Willem




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

Date: Sat, 18 Oct 2003 13:15:40 -0400
From: "James Q.L" <dragon@china.com>
Subject: how to keep database connection persistent
Message-Id: <szekb.8193$Z_2.582801@news20.bellglobal.com>

Hi,

i have a non-cgi script being called by users in command line. this script
query database and return data.
as this script is called frequently, i would like to keep a database
connection so it won't initiate a new db connection.

how do i do that ?

Regards,

Qiang




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

Date: Sat, 18 Oct 2003 16:41:56 -0500
From: "Eric J. Roode" <REMOVEsdnCAPS@comcast.net>
Subject: Re: how to keep database connection persistent
Message-Id: <Xns9418B40397C05sdn.comcast@216.196.97.136>

-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1

"James Q.L" <dragon@china.com> wrote in
news:szekb.8193$Z_2.582801@news20.bellglobal.com: 

> Hi,
> 
> i have a non-cgi script being called by users in command line. this
> script query database and return data.
> as this script is called frequently, i would like to keep a database
> connection so it won't initiate a new db connection.
> 
> how do i do that ?

You can't.  Why do you feel you need to?

- -- 
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/AwUBP5GzmGPeouIeTNHoEQIQ+gCgl2qeIUNMilsnA2sc5IDus44y8JoAoN5B
og/6fo/iDhiruGfENtf50Y5Y
=MZfN
-----END PGP SIGNATURE-----


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

Date: Sat, 18 Oct 2003 18:50:20 -0400
From: "James Q.L" <dragon@china.com>
Subject: Re: how to keep database connection persistent
Message-Id: <dtjkb.8338$Z_2.610568@news20.bellglobal.com>


"Eric J. Roode" <REMOVEsdnCAPS@comcast.net> wrote in message
news:Xns9418B40397C05sdn.comcast@216.196.97.136...
> -----BEGIN xxx SIGNED MESSAGE-----
> Hash: SHA1
>
> "James Q.L" <dragon@china.com> wrote in
> news:szekb.8193$Z_2.582801@news20.bellglobal.com:
>
> > Hi,
> >
> > i have a non-cgi script being called by users in command line. this
> > script query database and return data.
> > as this script is called frequently, i would like to keep a database
> > connection so it won't initiate a new db connection.
> >
> > how do i do that ?
>
> You can't.  Why do you feel you need to?
>

well. this script is really being called during user printing through our
print server. it checks user quota in database and proceed if it's
sufficient.
so if the query takes longer the user will have to wait longer.

asides from that, it's good to know if this is doable.

i found sql relay does that. will give it a go later.
http://sqlrelay.sourceforge.net/


Qiang




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

Date: 18 Oct 2003 22:17:54 GMT
From: anotherway83@aol.comnospam (The Mosquito ScriptKiddiot)
Subject: how would i handle this?
Message-Id: <20031018181754.15203.00000295@mb-m26.aol.com>

hey,

im building a full-fledged 32-bit assembler in perl (its really gonna be a perl
script) and i have a problem with the hash table that will hold the mnemonic -
opcode conversion info...this hash table is gonna be pretty big because its
gonna have all the info along with the various forms of each instruction

so instead of having to build the hash table everytime the script is run in a
session, i would like to make it so that in a given session, the hash table
gets constructed only the first time around and then stays in memory for later
use in that session, because that hash table info doesnt change at all

how would i go abt achieving this? any special modules needed?

thanks


--The Mosquito Scriptkiddiot. 
"Those who dance are often considered crazy by those who can't hear the music"


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

Date: Sat, 18 Oct 2003 13:12:00 +0200
From: Matija Papec <perl@my-header.org>
Subject: OT: IT Champions
Message-Id: <u152pvgfh6func9meaphlhbu9v7gah2f84@4ax.com>


Did you already meet a real Champion, do you know who they are, how they
behave and think, how to protect yourself against them?

http://sampioni.com/en/zasto_sampioni.htm
http://sampioni.com/en/Sampionski_manifest.htm

Please, share your experiences with other nonchampions. :)
http://sampioni.com/hr/forum/display_topic_threads.asp?ForumID=4&TopicID=20&PagePosition=1



-- 
Matija


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

Date: 18 Oct 2003 06:36:53 -0700
From: clusardi2k@aol.com (Christopher M. Lusardi)
Subject: Perl 'system' Creates Program That Dies When First C Program Dies
Message-Id: <d5cfdc47.0310180536.67dd9149@posting.google.com>

Hello,

   What are some simple ways to run a perl script from an initial c program 
which starts another C program that stays around after the first program goes
away? Perl starts the second C program. 

    I've tried using "system ('executable'), but when the first program is 
stopped the second stops without my intervention.  What I want to be able to do 
is run my first program that starts the perl script which starts another 
program that stays around after the first program ends its execution.


               Thank you,
               Christopher Lusardi


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

Date: Sat, 18 Oct 2003 17:18:34 GMT
From: Bob Walton <invalid-email@rochester.rr.com>
Subject: Re: Perl 'system' Creates Program That Dies When First C Program Dies
Message-Id: <3F9175E7.2010601@rochester.rr.com>

Christopher M. Lusardi wrote:

> Hello,
> 
>    What are some simple ways to run a perl script from an initial c program 
> which starts another C program that stays around after the first program goes
> away? Perl starts the second C program. 
> 
>     I've tried using "system ('executable'), but when the first program is 
> stopped the second stops without my intervention.  What I want to be able to do 
> is run my first program that starts the perl script which starts another 
> program that stays around after the first program ends its execution.
> 
> 
>                Thank you,
>                Christopher Lusardi
> 

Your question isn't really a Perl question, but rather an OS question -- 
the answer will be the same if it were another language that is kicking 
off your executables -- hence it is off-topic here.  And the answer will 
depend on your OS.  What is it?

-- 
Bob Walton
Email: http://bwalton.com/cgi-bin/emailbob.pl



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

Date: 18 Oct 2003 13:53:16 GMT
From: rmallonday@aol.com (RMallonday)
Subject: Perl security guru needed for a quick, 2 hr, job.
Message-Id: <20031018095316.19455.00000620@mb-m07.aol.com>

I have been using Perl to collect info from a publicly available web site.  The
site has been redesigned and I can no longer access the data with Perl, it is
available from a web browser with no problem.  Getting through the new page has
overtaxed my limited Perl capabilities and I need help!

Anyone interested?


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

Date: Sun, 19 Oct 2003 01:29:56 +0800
From: Lincoln Yeoh <junkto@tm.net.my>
Subject: Re: Perl security guru needed for a quick, 2 hr, job.
Message-Id: <n3u2pvsuh9i3int2pt61ue6vc3gjunnj4m@4ax.com>

On 18 Oct 2003 13:53:16 GMT, rmallonday@aol.com (RMallonday) wrote:

>I have been using Perl to collect info from a publicly available web site.  The
>site has been redesigned and I can no longer access the data with Perl, it is
>available from a web browser with no problem.  Getting through the new page has
>overtaxed my limited Perl capabilities and I need help!
>
>Anyone interested?

Doesn't LWP work with that site?




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

Date: 18 Oct 2003 18:06:13 GMT
From: rmallonday@aol.com (RMallonday)
Subject: Re: Perl security guru needed for a quick, 2 hr, job.
Message-Id: <20031018140613.10366.00000857@mb-m14.aol.com>

I am using LWP, but I can't get to the data page any longer, some new features.
 I think there are varibles stored in hidden fields that bounce you out if
they're not set.


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

Date: Sat, 18 Oct 2003 21:28:57 +0000 (UTC)
From: "David H. Adler" <dha@panix.com>
Subject: Re: Perl security guru needed for a quick, 2 hr, job.
Message-Id: <slrnbp3c4p.e2v.dha@panix2.panix.com>

In article <20031018095316.19455.00000620@mb-m07.aol.com>, RMallonday wrote:
> 
> Anyone interested?

You have posted a job posting or a resume in a technical group.

Longstanding Usenet tradition dictates that such postings go into
groups with names that contain "jobs", like "misc.jobs.offered", not
technical discussion groups like the ones to which you posted.

Had you read and understood the Usenet user manual posted frequently to
"news.announce.newusers", you might have already known this. :)  (If
n.a.n is quieter than it should be, the relevent FAQs are available at
http://www.faqs.org/faqs/by-newsgroup/news/news.announce.newusers.html)
Another good source of information on how Usenet functions is
news.newusers.questions (information from which is also available at
http://www.geocities.com/nnqweb/).

Please do not explain your posting by saying "but I saw other job
postings here".  Just because one person jumps off a bridge, doesn't
mean everyone does.  Those postings are also in error, and I've
probably already notified them as well.

If you have questions about this policy, take it up with the news
administrators in the newsgroup news.admin.misc.

http://jobs.perl.org may be of more use to you

Yours for a better usenet,

dha

-- 
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
tastes filling! less great!       - ignatz in #perl


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

Date: Sat, 18 Oct 2003 19:03:30 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Perl security guru needed for a quick, 2 hr, job.
Message-Id: <slrnbp3l6i.cig.tadmc@magna.augustmail.com>

RMallonday <rmallonday@aol.com> wrote:
> I am using LWP, but I can't get to the data page any longer, some new features.
>  I think there are varibles stored in hidden fields that bounce you out if
> they're not set.


Use the Web Scraping Proxy (wsp.pl) to spy on what is being
passed back and forth.

It is pretty slick for reverse-engineering what is going on.


   http://www.research.att.com/~hpk/wsp/


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Sat, 18 Oct 2003 09:44:42 GMT
From: "Webmaster" <webmaster@kmaproductions.com>
Subject: Prove this wrong!!!!
Message-Id: <eY7kb.59868$KJ5.13433@fe2.columbus.rr.com>

Prove this wrong!!!

I don't know about you, but I get tired of postal lottery, "make
$60000 in 60 days" type messages appearing in my favorite newsgroups.
There are "claims" of people making all this money, but nothing to
back it up or any real proof.

So now we're going to put this to a test and hopefully settle this
once and for all!

If you believe these type of letters/messages work, then try the
newer PayPal version of this listed below. I have added my e-mail
address at the bottom of the message, and will post the results daily
on my website (listed further down in this message)

Even if you don't believe these type of letters work, check out the
results on my web page :

http:\\www.kmaproductions.com\watchdog.htm

Hopefully, you can use this link as a way of telling people that these
type of messages do not work and finally put this nonsense to rest.

========================================================

Follow the directions below and in two weeks you'll have up to
$20000.00 in your PayPal account. There is a very high rate of
participation in the program because of its low investment and high
rate of return. Just $5.00 to one person!

THAT'S ALL !!!

If you are a skeptic and don't think the program will work, I urge
you to give it a try anyway! It REALLY WORKS! Why do you
think so many people are promoting it ?

LOOK AT IT THIS WAY: If the Program is a total failure for you and you
never get even $1.00 in return, your total loss will
be the $5.00! If you are not yet a paypal member, there is no risk at
all!!! If the Program is only moderately successful for
you, your PayPal account will have several hundred dollars deposited
into it within the next few days! If you actively
participate in the Program, you could have up to $20,000.00 in your
PayPal account within two weeks!

Now let me tell you the simple details.

Getting Started!!

If you're not already a user of PayPal, the very first thing you need
to do is go to PayPal and sign up. It takes two minutes
and Pay Pal will deposit $5.00 in your account just for becoming a
member. That makes this program's total cost $0!!! Follow
this link to open your PayPal account:

https://www.paypal.com

Now log into your PayPal account, and send the PayPal account of the
person listed in Position 1 $5.00 PayPal will ask you to
select type. (Select "service" and put "$5.00 donation" for
subject.) When person in Position 1 receives notification of your
payment, you can simply copy this page and change the names in
position #1 & #2 & #3 as instructed. Remember, only the person
in Position 1 on the list gets your $5.00 donation. Send them a
donation then remove #1PayPal account from the list. Move the
other two accounts up & add your Paypal account to #3 position. After
you have retyped the names in the new order,

IMMEDIATELY send the revised message to as many people as possible.
PROMOTE! PROMOTE! The more you promote the Program, the
more you will receive in donations!! That's all there is to it.

When your name reaches Position 1 (usually in less than a week) it
will be your turn to receive the cash. $5.00 will be sent
to your PayPal account by people just like you who are willing to send
$5.00 dontation and receive up to $20,000 in less than
two weeks. Because there are only (3) names on the list you can
anticipate 80% of your cash within two weeks.

Anytime you find yourself short on cash just take out your $5.00
donation program and send it to 50 prospects. Imagine if you
sent it to 100 or even more. Most people spend more than $5 on the
lottery every week with no real hope of ever winning.

THIS PROGRAM WORKS - JUST TRY IT

POSITION # 1 PAYPAL Account: wishome@hotmail.com

POSITION # 2 PAYPAL ACCOUNT: Sarah_Mitchell_104@hotmail.com

POSITION # 3 PAYPAL ACCOUNT: webmaster@kmaproductions.com

Integrity and honesty make this plan work.
Participants who actively promote this program will average between
$8000 and $12000 and receive the donations within two weeks.

This is not a chain letter. You are simply making a donation of $5.00
to another person. The Program does not violate title
18 section 1302 of the Postal and lottery code.

Remember -TIME is of the essence. YOU can choose to live
Paycheck-to-Paycheck or live FREE from FINANCIAL BONDAGE. Become a
part of the donation program and help people help people.

This program is about helping each other!

Success is a journey - Not a destination!

Start Your Journey TODAY!!!!









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

Date: 17 Oct 2003 19:53:54 -0700
From: wherrera@lynxview.com (Bill)
Subject: Re: regex @a = m /  |  /g and captures?
Message-Id: <239ce42f.0310171853.4939b8a5@posting.google.com>

Steve Grazzini <grazz@pobox.com> wrote in message news:<iXUjb.33$PZ1.5@nwrdny03.gnilink.net>...
> 
> Put the parentheses around the entire expression.
> 
> > @a = $s =~ m/(\{[^\}]+\})|(\d)/g;
> 
>              /( { [^}]+ } | \d )/xg; 
> 

Oh yes, of course! Cool. 
But I think that I simplified the code I was revising too far.

What about this (we want the numbers not the separators):
>>>>>>>>>>>

my $s = '1; 2; {3, 3, 3}; 4;';

my @a = $s =~ m/\{[^\}]+\};|\d;/g;

print "\nWithout captures:\n", join "\n", @a;

@a = $s =~ m/(\{[^\}]+\});|(\d);/g;
foreach(@a) { $_ = 'undef' unless $_; }
print "\n\nNow with captures:\n", join "\n", @a;

<<<<<<<<<<<

It seems that either I have to chop the answers here or filter undefs,
as Tad suggests?


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

Date: 18 Oct 2003 09:31:00 -0700
From: quantum_mechanic_1964@yahoo.com (Quantum Mechanic)
Subject: Re: regex @a = m /  |  /g and captures?
Message-Id: <f233f2f0.0310180830.7bb48262@posting.google.com>

wherrera@lynxview.com (Bill) wrote in message news:<239ce42f.0310171853.4939b8a5@posting.google.com>...
> >              /( { [^}]+ } | \d )/xg; 
> > 
> 
> Oh yes, of course! Cool. 
> But I think that I simplified the code I was revising too far.
> 
> What about this (we want the numbers not the separators):
> >>>>>>>>>>>
> 
> my $s = '1; 2; {3, 3, 3}; 4;';
> 
> my @a = $s =~ m/\{[^\}]+\};|\d;/g;

Then move the common elements (semi-colon) out of the alternation. In
this case, they can be moved out of the capture as well:

     /( { [^}]+ } | \d );/xg;

But you haven't stated whether the semi-colons are always there, or
meaningful. If they have no meaning, you can go with the previous
version:

> >              /( { [^}]+ } | \d )/xg; 

-QM


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

Date: 18 Oct 2003 16:46:11 -0700
From: wherrera@lynxview.com (Bill)
Subject: Re: regex @a = m /  |  /g and captures?
Message-Id: <239ce42f.0310181546.27378177@posting.google.com>

quantum_mechanic_1964@yahoo.com (Quantum Mechanic) wrote in message news:<f233f2f0.0310180830.7bb48262@posting.google.com>...

> > >>>>>>>>>>>
> > 
> > my $s = '1; 2; {3, 3, 3}; 4;';
> > 
> > my @a = $s =~ m/\{[^\}]+\};|\d;/g;
> 
> Then move the common elements (semi-colon) out of the alternation. In
> this case, they can be moved out of the capture as well:
> 
>      /( { [^}]+ } | \d );/xg;
> 
> But you haven't stated whether the semi-colons are always there, or
> meaningful. If they have no meaning, you can go with the previous
> version:
> 
> > >              /( { [^}]+ } | \d )/xg; 
> 
> -QM

So, I guess the answer in general is just to find a way to rewrite the
regex so that there is only one capture. It's good that regexes are so
flexible. Thanks


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

Date: 18 Oct 2003 20:06:37 +0200
From: Edi Weitz <edi@agharta.de>
Subject: Re: Scope of \Q, \L, \U, etc.
Message-Id: <87k7728loy.fsf@bird.agharta.de>

On Fri, 17 Oct 2003 23:34:35 GMT, tiltonj@erols.com (Jay Tilton) wrote:

> When investigating how Perl gets its DWIM, squeezing code through
> the B::Deparse backend complements the test/hypothesize cycle very
> well.

Thanks, I didn't know about that one.

> I don't see an explanation of what's really going on in perlop.
> Maybe it could stand to have a brief note added.

Yes, I think so.

Thanks for your help,
Edi.


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

Date: Sat, 18 Oct 2003 03:17:35 GMT
From: Bill <wherrera@lynxview.com>
Subject: Re: TCP close_wait problem
Message-Id: <jh2kb.110226$qj6.5679009@news1.news.adelphia.net>

Grant wrote:
> The Perl script resides on a Solaris 8 box, using Perl 5.8.0. Since
> I've done a bit of C coding in the past, I've been able to determine
> what the code is doing. It's a multithreaded script that opens a
> socket to a number of W2K servers and reads data that is spit out from
> an app on the W2K servers (data is dumped to port 3000 on its own
> machine, a socket connection is made to this port, and the data is
> picked up). The data then is dumped into a Queue from all operating
> threads, then piped into another probe for further processing.

> The problem occurs when the app on the W2K box initiates a disconnect.

I think perhaps that this is where the problem lies. Maybe your perl 
program needs to initiate the disconnect from the socket it opened itself.

> I installed Windump on the W2K server, and saw that the app does send
> a FIN and ACK, and does recieve an ACK back from the Perl probe, but
> the FIN and ACK from the probe are never sent to the W2K server. Thus,
> the W2K machine is stuck in a FIN_WAIT_2 state, and the Solaris
> machine in a CLOSE_WAIT state. The states remain until the Perl probe

Does the Perl program know when it is done with the read, or can it use 
an independent activity timeout routine for this read if it cannot 
otherwise know?

If so, can the perl program initiate the disconnect, or even just exit, 
   without the Win32 box doing so first?



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

Date: 18 Oct 2003 06:32:11 -0700
From: stud1174@di.uoa.gr (Kostas Hatzikokolakis)
Subject: Use perl in apache without #!/path/to/perl
Message-Id: <bbc975e8.0310180532.7d3ae8a7@posting.google.com>

Hi,
I want to set up apache to use the perl interpreter automatically for
all .pl files, without the need to have a #!/path/to/perl directive in
each file. This is beacause I want to use a winows machine to test
some scripts created in linux, thus havind #!/usr/bin/perl instead of
#!c:\Perl\bin\perl.exe. I tried the following in httpd.conf

AddType application/x-httpd-perl .pl
ScriptAlias /_pl/ "c:/perl/bin/"
Action application/x-httpd-perl "/_pl/perl.exe"

that should normaly do the trick (i configured php similarly) but I
get the following error:

[Sat Oct 18 15:22:16 2003] [error] [client 127.0.0.1] Premature end of
script headers: perl.exe

Does anyone have a solution to this problem?
Thanks in advance.

Kostas Chatzikokolakis


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

Date: Sat, 18 Oct 2003 14:17:22 GMT
From: James Willmore <jwillmore@remove.adelphia.net>
Subject: Re: Use perl in apache without #!/path/to/perl
Message-Id: <20031018101748.20169967.jwillmore@remove.adelphia.net>

On 18 Oct 2003 06:32:11 -0700
stud1174@di.uoa.gr (Kostas Hatzikokolakis) wrote:

> Hi,
> I want to set up apache to use the perl interpreter automatically
> for all .pl files, without the need to have a #!/path/to/perl
> directive in each file. This is beacause I want to use a winows
> machine to test some scripts created in linux, thus havind
> #!/usr/bin/perl instead of#!c:\Perl\bin\perl.exe. I tried the
> following in httpd.conf
> 
> AddType application/x-httpd-perl .pl
> ScriptAlias /_pl/ "c:/perl/bin/"
> Action application/x-httpd-perl "/_pl/perl.exe"
> 
> that should normaly do the trick (i configured php similarly) but I
> get the following error:
> 
> [Sat Oct 18 15:22:16 2003] [error] [client 127.0.0.1] Premature end
> of script headers: perl.exe
> 
> Does anyone have a solution to this problem?
> Thanks in advance.
> 
> Kostas Chatzikokolakis

Yes - read the Apache documentation (http://httpd.apache.org/).  It is
outlined there what to do to set up running scripts.

Just a hint - your ScriptAlias is wrong.  It needs to point to where
the scripts are located, _not_ where the Perl interpreter is.  If you
have put your Perl scripts in the same directory as the Perl
interpreter, you have now opened a very large security hole on your
server.

HTH

-- 
Jim

Copyright notice: all code written by the author in this post is
 released under the GPL. http://www.gnu.org/licenses/gpl.txt 
for more information.

a fortune quote ...
If all else fails, immortality can always be assured by
<spectacular error.   -- John Kenneth Galbraith 


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

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


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