[24954] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 7204 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Oct 3 11:06:53 2004

Date: Sun, 3 Oct 2004 08: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           Sun, 3 Oct 2004     Volume: 10 Number: 7204

Today's topics:
    Re: Custom Perl Scripting <lsmsintelligence@hotmail.com>
    Re: Custom Perl Scripting <lsmsintelligence@hotmail.com>
    Re: Custom Perl Scripting <lsmsintelligence@hotmail.com>
    Re: Custom Perl Scripting <spamtrap@dot-app.org>
    Re: Custom Perl Scripting <jurgenex@hotmail.com>
    Re: How to test if I got Mod_Perl in apache? <asdf@asdfsadf.com>
    Re: How to test if I got Mod_Perl in apache? <spamtrap@dot-app.org>
    Re: How to test if I got Mod_Perl in apache? <noreply@gunnar.cc>
    Re: How to test if I got Mod_Perl in apache? <noreply@gunnar.cc>
    Re: How to test if I got Mod_Perl in apache? <Juha.Laiho@iki.fi>
    Re: How to test if I got Mod_Perl in apache? <spamtrap@dot-app.org>
    Re: How to test if I got Mod_Perl in apache? <Juha.Laiho@iki.fi>
    Re: How to test if I got Mod_Perl in apache? <noreply@gunnar.cc>
    Re: How to test if I got Mod_Perl in apache? <zentara@highstream.net>
    Re: How to test if I got Mod_Perl in apache? <dug@plusthree.com>
    Re: Is PHP still slower than Perl? <shawn.corey@sympatico.ca>
    Re: tr problem <usenet@morrow.me.uk>
        Why a Perl script ran on Shell andr Windows but not on  <asdf@asdfsadf.com>
    Re: Why a Perl script ran on Shell andr Windows but not <spamtrap@dot-app.org>
    Re: Why a Perl script ran on Shell andr Windows but not <see@sig.invalid>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 3 Oct 2004 05:21:23 -0700
From: "Perl Newbie" <lsmsintelligence@hotmail.com>
Subject: Re: Custom Perl Scripting
Message-Id: <1096806083.266886.14460@k17g2000odb.googlegroups.com>

Thanks, I'll look in to Java-based opportunites for my difficulty.



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

Date: 3 Oct 2004 05:23:20 -0700
From: "Perl Newbie" <lsmsintelligence@hotmail.com>
Subject: Re: Custom Perl Scripting
Message-Id: <1096806200.502946.18660@k17g2000odb.googlegroups.com>

How?



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

Date: 3 Oct 2004 05:23:54 -0700
From: "Perl Newbie" <lsmsintelligence@hotmail.com>
Subject: Re: Custom Perl Scripting
Message-Id: <1096806234.709843.273590@k26g2000oda.googlegroups.com>

How doest the print function work?



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

Date: Sun, 03 Oct 2004 08:31:47 -0400
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: Custom Perl Scripting
Message-Id: <F7mdnRpo0uqubMLcRVn-gg@adelphia.com>

Perl Newbie wrote:

> How doest the print function work?

You're joking, right? It works like the docs say it works. Read them 
yourself - just enter:

perldoc -f print

at a command prompt.

sherm--

-- 
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org


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

Date: Sun, 03 Oct 2004 12:47:04 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Custom Perl Scripting
Message-Id: <cxS7d.2478$Xk1.2051@trnddc02>

[Fullquote intended]
Perl Newbie wrote:
> How?

How wht? How to do custom Perl scripting?
Simple, just write your custom program in Perl and you have custom Perl 
scripting.

jue





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

Date: Sun, 3 Oct 2004 07:34:29 -0400
From: "@" <asdf@asdfsadf.com>
Subject: Re: How to test if I got Mod_Perl in apache?
Message-Id: <WvKdnWXvmod_fsLcRVn-qw@rogers.com>

> > Here is mine:
> > 2004-10-03 03:44:17.782 Server: Apache/1.3.29 (Unix)
>
> Your server does not have mod_perl installed. See how easy that was?
>
> > However, mine does have PHP, so it is very possible that the Apache is
set
> > up not to say anything about those added headers.
>
> Possible? Sure, anything's possible - including little green men on
> Mars. But I won't bet on that, or on your server having mod_perl and not
> reporting it.

If it has PHP but not report it, then it is possible for mod_perl too.
In fact, openssl is working but not reported too.

I just want to know if my perl cgi is faster than PHP is because I got
mod_perl or the fact is PHP is still too much slower than Perl regardless of
apache settings.




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

Date: Sun, 03 Oct 2004 08:00:17 -0400
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: How to test if I got Mod_Perl in apache?
Message-Id: <c7CdnQp467hPdMLcRVn-oA@adelphia.com>

@ wrote:

> I just want to know if my perl cgi is faster than PHP is because I got
> mod_perl

It's not. As I said, you need to be aware of mod_perl and write your 
code specifically to take advantage of it to see any significant 
performance boost.

So even if you *did* have mod_perl on your server - and I'm certain that 
you don't - you wouldn't be getting any performance gains from it, 
because you haven't optimized your Perl code for it.

sherm--

-- 
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org


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

Date: Sun, 03 Oct 2004 14:15:50 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: How to test if I got Mod_Perl in apache?
Message-Id: <2sa92oF1hpo6kU1@uni-berlin.de>

Sherm Pendley wrote:
> So even if you *did* have mod_perl on your server - and I'm certain
> that you don't - you wouldn't be getting any performance gains from
> it, because you haven't optimized your Perl code for it.

Quote from http://perl.apache.org/start/tips/registry.html :

"Existing CGI scripts will run much faster under mod_perl."

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


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

Date: Sun, 03 Oct 2004 14:28:15 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: How to test if I got Mod_Perl in apache?
Message-Id: <2sa9q2F1io2vkU1@uni-berlin.de>

@ wrote:
> Is there any way to tell if mod_perl is installed in apache? I am
> using a shared account. No root access.

You can check whether $ENV{MOD_PERL} is set. If it is, your script is
running under mod_perl, if not, mod_perl is not enabled for your
account whether it happens to be installed or not.

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


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

Date: Sun, 3 Oct 2004 12:42:15 +0000 (UTC)
From: Juha Laiho <Juha.Laiho@iki.fi>
Subject: Re: How to test if I got Mod_Perl in apache?
Message-Id: <cjos37$jen$1@ichaos.ichaos-int>

"@" <asdf@asdfsadf.com> said:
>Is there any way to tell if mod_perl is installed in apache? I am using a
>shared account. No root access.

You might write a perl-based page where you print a value from the
Apache::Constants package -- that should only be available for
mod_perl environments. Also Apache::Status package might be one you
could use for testing.

And then the easy way: ask your hosting provider.
(answer of "don't know" means you need to change providers)
-- 
Wolf  a.k.a.  Juha Laiho     Espoo, Finland
(GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V
         PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++
"...cancel my subscription to the resurrection!" (Jim Morrison)


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

Date: Sun, 03 Oct 2004 08:50:34 -0400
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: How to test if I got Mod_Perl in apache?
Message-Id: <lPSdnYBsG_gBaMLcRVn-ug@adelphia.com>

Gunnar Hjalmarsson wrote:

> Quote from http://perl.apache.org/start/tips/registry.html :
> 
> "Existing CGI scripts will run much faster under mod_perl."

That has not been my experience - and I've done a *lot* of mod_perl, for 
sites that get more traffic than slashdot.

On the other hand, the scripts I've worked with have been as small and 
tight as I could make them to begin with. They didn't benefit all that 
much by simply dropping them into Apache::Registry, since the compiler 
overhead for those scripts wasn't all that much to begin with.

I can see where the difference would be much more dramatic though, if 
you're dealing with a 10kloc behemoth that spends as much or more time 
compiling than it does running. ;-)

sherm--

-- 
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org


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

Date: Sun, 3 Oct 2004 12:47:22 +0000 (UTC)
From: Juha Laiho <Juha.Laiho@iki.fi>
Subject: Re: How to test if I got Mod_Perl in apache?
Message-Id: <cjoscq$jen$2@ichaos.ichaos-int>

"@" <asdf@asdfsadf.com> said:
>2004-10-03 03:44:17.782 Server: Apache/1.3.29 (Unix)
>However, mine does have PHP, so it is very possible that the Apache is set
>up not to say anything about those added headers.

This output can be achieved with 'ServerTokens OS' in the Apache httpd.conf.
So, no great magic needed - and it's rather common to set up Apache this
way to reduce the amount of information it provides for potential attackers.
-- 
Wolf  a.k.a.  Juha Laiho     Espoo, Finland
(GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V
         PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++
"...cancel my subscription to the resurrection!" (Jim Morrison)


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

Date: Sun, 03 Oct 2004 15:29:37 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: How to test if I got Mod_Perl in apache?
Message-Id: <2sadd8F1iniruU1@uni-berlin.de>

Sherm Pendley wrote:
> Gunnar Hjalmarsson wrote:
>> Quote from http://perl.apache.org/start/tips/registry.html :
>> 
>> "Existing CGI scripts will run much faster under mod_perl."
> 
> That has not been my experience - and I've done a *lot* of
> mod_perl, for sites that get more traffic than slashdot.

Thanks for sharing; I have never really understood what's the magic
that would make that statement true.

> On the other hand, the scripts I've worked with have been as small
> and tight as I could make them to begin with. They didn't benefit
> all that much by simply dropping them into Apache::Registry, since
> the compiler overhead for those scripts wasn't all that much to
> begin with.
> 
> I can see where the difference would be much more dramatic though,
> if you're dealing with a 10kloc behemoth that spends as much or
> more time compiling than it does running. ;-)

Such as loading POSIX for a simple date formating, or CGI for a simple
query-string parsing...

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


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

Date: Sun, 03 Oct 2004 09:37:03 -0400
From: zentara <zentara@highstream.net>
Subject: Re: How to test if I got Mod_Perl in apache?
Message-Id: <5tvvl01a88he55fgfl02hbck1g93jcc2h5@4ax.com>

On Sun, 03 Oct 2004 11:08:22 +1000, Gregory Toomey <nospam@bigpond.com>
wrote:

>@ wrote:
>
>> Is there any way to tell if mod_perl is installed in apache? I am using a
>> shared account. No root access.
>
>You probably can't if if have a shared account. As root, you need to type
>type 'httpd -l ' and look for mode_perl.
>
>And you will need to modify httpd.conf, which you probably cant do either.
>
>Try a cheap VPS at www.linode.com or similar.
>
>gtoomey

This is a tip I have, but I don't use mod_perl so it's just "as is".

#!/usr/bin/perl
 print "Content-type: text/html\n\n";
 while (($key,$value) = each %ENV) {
 print "$key=$value<br>";
}

# look for the line saying "Gateway Interface". If it says "CGI/1.1"  
# then  you are using the standard apache-perl interface, but if it says
#"CGI-Perl/1.1" then you are running it through mod_perl 




-- 
I'm not really a human, but I play one on earth.
http://zentara.net/japh.html


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

Date: 3 Oct 2004 14:30:13 GMT
From: Douglas Hunter <dug@plusthree.com>
Subject: Re: How to test if I got Mod_Perl in apache?
Message-Id: <slrncm02uk.33p.dug@plusthree.com>

On 2004-10-03, Gunnar Hjalmarsson <noreply@gunnar.cc> wrote:
> Sherm Pendley wrote:
>> Gunnar Hjalmarsson wrote:
>>> Quote from http://perl.apache.org/start/tips/registry.html :
>>> 
>>> "Existing CGI scripts will run much faster under mod_perl."
>> 
>> That has not been my experience - and I've done a *lot* of
>> mod_perl, for sites that get more traffic than slashdot.
>
> Thanks for sharing; I have never really understood what's the magic
> that would make that statement true.

It's not really magic.  It's the overhead involved in executing two 
processes as opposed to one, combined with the fact that every time 
a CGI script is executed the child process re-parses and executes
itself.  Of course the second half of that overhead is alleviated by
moving to a compiled language for CGI scripts, but I certainly don't
want that headache.

>> 
>> I can see where the difference would be much more dramatic though,
>> if you're dealing with a 10kloc behemoth that spends as much or
>> more time compiling than it does running. ;-)
>
> Such as loading POSIX for a simple date formating, or CGI for a simple
> query-string parsing...
>

I have never seen a "simple" instance of handling dates or query
strings {grin}.

-- Douglas Hunter



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

Date: Sun, 03 Oct 2004 08:42:37 -0400
From: Shawn Corey <shawn.corey@sympatico.ca>
Subject: Re: Is PHP still slower than Perl?
Message-Id: <3sS7d.44$jj2.18103@news20.bellglobal.com>

Tony Marston wrote:
> I don't waste my time posting to a Microsoft newsgroup saying that all MS 
> products suck (otherwise I'd never get anything done), so what makes you (or 
> anyone else) think that you can post such comments to this group without 
> getting an animated response.
> 
> You may think that Perl is better than PHP (what is your justification?) and 
> as it is still a free country (that is until President Blair finishes 
> screwing up the constitution) it is your God-given right to hold that 
> opinion. I think you are wrong, but it is still your right.
> 

What good is having a debate on the merits of two languages if you 
solicit opinions from only one side? If this thread was only posted to 
one newsgroup, I would have 'Ignore Thread' a long time ago.

	--- Shawn


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

Date: Thu, 30 Sep 2004 17:39:40 +0100
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: tr problem
Message-Id: <cfpt22-4d5.ln1@osiris.mauzo.dyndns.org>


Quoth Ala Qumsieh <notvalid@email.com>:
> Christian Winter wrote:
> > Tad McClellan schrieb:
> >> IanW <onedoesnot@needto.know> wrote:
> >>
> >>> Btw, I could shorten that regexp more by doing:
> >>>
> >>> $_ =~ s/^(\S+)/\U$1/;
> >>
> >> If short is your goal, then you can improve it even further:
> >>
> >>    s/^(\S+)/\U$1/;
> > 
> > s/^\S+/\U$&/;
> 
>    s/\S+/\U$&/;

Not equivalent. Consider $_ = ' a'.

Ben

-- 
If I were a butterfly I'd live for a day, / I would be free, just blowing away.
This cruel country has driven me down / Teased me and lied, teased me and lied.
I've only sad stories to tell to this town: / My dreams have withered and died.
  ben@morrow.me.uk                                                 (Kate Rusby)


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

Date: Sun, 3 Oct 2004 07:31:15 -0400
From: "@" <asdf@asdfsadf.com>
Subject: Why a Perl script ran on Shell andr Windows but not on Apache Linux?
Message-Id: <Ztmdnaiz85ODfsLcRVn-tQ@rogers.com>

It rarely happens to me. I made sure it is FTPed in ACSII, set to 755. It
runs on Apache on Windows. It runs in Shell. But always gave me error 500. I
don't have access to detailed error log.

What other reasons it could be? How do I debug it in this situation?

the first few lines of output form shell are as:
HTTP/1.0 200 OK
Date: Sun, 03 Oct 2004 11:28:43 GMT
Content-type: text/html

<html>
<head>
<title>Start Using CGIProxy</title>
</head>
<body>

It looks good. The fact it is working well on Apache Windows means the
header is ok.
Because it runs well on shell, it means all depended modules are installed.




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

Date: Sun, 03 Oct 2004 08:02:36 -0400
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: Why a Perl script ran on Shell andr Windows but not on Apache Linux?
Message-Id: <c7CdnQV467jAd8LcRVn-oA@adelphia.com>

@ wrote:

> don't have access to detailed error log.

Then send error messages to the browser instead:

use CGI::Carp qw(fatalsToBrowser);

sherm--

-- 
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org


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

Date: Sun, 03 Oct 2004 10:23:20 -0400
From: Bob Walton <see@sig.invalid>
Subject: Re: Why a Perl script ran on Shell andr Windows but not on Apache Linux?
Message-Id: <41600968$1_2@127.0.0.1>

@ wrote:
> It rarely happens to me. I made sure it is FTPed in ACSII, set to 755. It
> runs on Apache on Windows. It runs in Shell. But always gave me error 500. I
> don't have access to detailed error log.
> 
> What other reasons it could be? How do I debug it in this situation?
> 
> the first few lines of output form shell are as:
> HTTP/1.0 200 OK
> Date: Sun, 03 Oct 2004 11:28:43 GMT
> Content-type: text/html
> 
> <html>
> <head>
> <title>Start Using CGIProxy</title>
> </head>
> <body>
> 
> It looks good. The fact it is working well on Apache Windows means the
> header is ok.
> Because it runs well on shell, it means all depended modules are installed.
> 
> 

Have you checked the FAQ?

    perldoc -q 500

If you have and have chased down *everything* offered there, post again 
saying so and giving more details, including sample code that 
demonstrates your problem.  Make sure and

    use CGI::Carp qw(fatalsToBrowser);

(you didn't

    use CGI;

either, did you?)

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


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

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


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