[23157] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5378 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Aug 17 11:05:54 2003

Date: Sun, 17 Aug 2003 08:05:08 -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, 17 Aug 2003     Volume: 10 Number: 5378

Today's topics:
    Re: 'make' implemented in Perl <tzz@lifelogs.com>
    Re: 'make' implemented in Perl <tzz@lifelogs.com>
    Re: and why can't I do my own CGI? <gellyfish@gellyfish.com>
    Re: CGI is not so hard <gellyfish@gellyfish.com>
    Re: CGI is not so hard <jurgenex@hotmail.com>
    Re: CGI is not so hard <Juha.Laiho@iki.fi>
    Re: comp.lang.perl.open.discussion rfc in alt.config <gellyfish@gellyfish.com>
    Re: comp.lang.perl.open.discussion rfc in alt.config (Jon Bell)
    Re: Extremely Basic mySQL question. <gellyfish@gellyfish.com>
    Re: file upload in cgi <me@privacy.net>
    Re: how to rename 200 files in many sub-directories? <gellyfish@gellyfish.com>
    Re: how to rename 200 files in many sub-directories? <krahnj@acm.org>
    Re: how to rename 200 files in many sub-directories? <ian@WINDOZEdigiserv.net>
    Re: how to rename 200 files in many sub-directories? (Tad McClellan)
    Re: Hudson River <me@privacy.net>
    Re: Hudson River <noreply@gunnar.cc>
    Re: In My Humble Opinion... <me@privacy.net>
    Re: mod_perl 2 Setup ? <welton_bob@nospam_hotmail.com>
    Re: mod_perl 2 Setup ? <welton_bob@nospam_hotmail.com>
    Re: Newbie Formhandler <gellyfish@gellyfish.com>
    Re: perl hacking for fun and pleasure <gellyfish@gellyfish.com>
        simple perl script <jamesbond_422@hotmail.com>
    Re: simple perl script <shawn@magma.ca>
    Re:  <bwalton@rochester.rr.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Sun, 17 Aug 2003 06:28:24 -0400
From: Ted Zlatanov <tzz@lifelogs.com>
Subject: Re: 'make' implemented in Perl
Message-Id: <4nwudcefxz.fsf@lockgroove.bwh.harvard.edu>

On Sat, 16 Aug 2003, pkent77tea@yahoo.com.tea wrote:

> I missed the start of this thread but this reminds me of:
> http://magnonel.guild.net/~schwern/talks/MakeMaker_Is_DOOMED/slides/

That was really useful, thanks.  It answered pretty much every
question I had.

Ted


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

Date: Sun, 17 Aug 2003 06:41:56 -0400
From: Ted Zlatanov <tzz@lifelogs.com>
Subject: Re: 'make' implemented in Perl
Message-Id: <4nsmo0efbf.fsf@lockgroove.bwh.harvard.edu>

On Thu, 14 Aug 2003, emschwar@pobox.com wrote:

> Anyway, as you yourself thoughtfully pointed out, people wanting to
> install (most) CPAN modules can just use ppm or apt-get or rpm or
> whatever and install them.  This works for pure-Perl as well as XS
> modules.

Unfortunately all of those methods are bad in one way or another:

PPM is not easy to use, there's no automatic MakeMaker to PPM
conversion, and virtually none other than ActiveState uses it.

apt-get or RPM know little about the Perl install process, and are not
CPAN-compatible or even OS-independent (modules have to be specially
prepared for a distro, and that's mostly Linux at this point).

> Ted Zlatanov <tzz@lifelogs.com> writes:
>> If I think there's no good alternative, I might write my own
>> make.pl, but 4 such programs have been pointed out already.  I
>> might also write something that interprets Makefile.PL on the fly
>> and skips the `make' step if possible, but I want to find out if a)
>> such a thing is planned/exists already, and b) there's a better way
>> to do it.
> 
> I think we've answered those questions so far: a) no.  b) we don't
> think so, but if you do, you're welcome to prove us wrong.  And I'm
> quite sincere in that; if you can come up with something that works
> in all cases, that's great.
> 
>> The simplest fix is to include make.pl (which is compatible with
>> the standard Makefile syntax, according to its web page) with the
>> CPAN module and use it instead of `make.'
> 
> Go to it.  Let us know how it goes.

The link posted by pkent to the Module::Build talk by Michael Schwern
convinced me that I really don't need to do this.  Module::Build can
generate the wrappers I suggested, down to "make;make install," and it
can rewrite existing MakeMaker configurations.  The talk also pretty
much reiterated all my arguments about why we should avoid make - do
read it if you get a chance.

> As you seem to be the only person interested in having the code,
> you're logically the best person to write it.

Given Schwern's talk, I'm glad you were wrong, rewriting Module::Build
would have been annoying :) 

>> So CPANPLUS.pm appears to continue the CPAN.pm `make' usage.
> 
> So submit a patch; if the author like it, no doubt it'll be
> accepted.

Module::Build is already supported, so I need do nothing there.

Thanks
Ted


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

Date: Sun, 17 Aug 2003 10:16:16 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: and why can't I do my own CGI?
Message-Id: <QBI%a.1$Yx6.67@news.dircon.co.uk>

Hudson <scripts_you-know-the-drill_@hudsonscripting.com> wrote:
>>Reinventing wheels is for cavemen.
> 
> thank you Eric.
> 
> you know what...parsing CGI is kind of a bitch...maybe I should just
> load in part of a module and not use the whole thing.

You might want to examine the code of CGI.pm: although the actual file is
quite large it employs a number of techniques to keep the load and parse
time to a minimum - whilst the entire file must be read by perl, on the most
part only those methods that are actually used are parsed and compiled, so
splitting the file up is unlikely to lead to a great improvement in 
performance and is likely to introduce new bugs.

/J\
-- 
Jonathan Stowe                      |
<http://www.gellyfish.com>          |      This space for rent
                                    |


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

Date: Sun, 17 Aug 2003 10:47:48 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: CGI is not so hard
Message-Id: <o3J%a.2$Yx6.286@news.dircon.co.uk>

Hudson <scripts_you-know-the-drill_@hudsonscripting.com> wrote:
> and soap is even easier:
> from: http://www.w3.org/TR/SOAP/#_Toc478383490
> 
> Example 1 SOAP Message Embedded in HTTP Request
> 

<snip>

> 
> not so hard...just connect to a socket, send header and request...you
> guys here are really lamers ;-)

Well, no, sending that specific request wouldn't seem to be so difficult on
the face of it, but of course then you find yourself with the issue of
interpreting the response, dealing with a fault response if there is one,
and handling the possibility that the service might alter the version of
SOAP that is being used among other things.  SOAP::Lite will handle these
things for you without you having to reinvent the wheel.

*I* do understand SOAP and have read the specification, and indeed could
hand code implementations *for languages where no reusable library was
available*, however as libraries are available in the majority of languages
that I am ever likely to use (hell, I even made the gSOAP libray work with
Informix 4GL) this is an unlikely thing to happen.

I don't think anyone here is suggesting that you shouldn't be familiar
with the specification of a particular protocol that you might find
yourself working, they just understand good software engineering practice
and will tend to encourage you to make use of a well tested piece of
reusable code rather and discourage you from making your own incomplete
and possibly buggy implementation.

HTH

/J\
-- 
Jonathan Stowe                      |
<http://www.gellyfish.com>          |      This space for rent
                                    |


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

Date: Sun, 17 Aug 2003 14:22:48 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: CGI is not so hard
Message-Id: <YcM%a.6971$Bo6.3922@nwrddc03.gnilink.net>

hudson wrote:
>>> read (STDIN, my $input, $ENV{'CONTENT_LENGTH'});
>>> my @kv = split (/&/, $input);
>>> for my $kv (@kv)
>>>
>>> etc....that's not just grabbing an environmental varible?
>>
>>
>> No, that is not just grabbing an environmental varible (sic).
>>
>> It is also reading input from stdin.
>
> OK...so I confused stdin with an environmental varible (TM)
> can't I still be a Perl hacker, even if I don't know all the terms ;-)

Sure. It just makes it difficult for _you_ to understand the documentation
(and how do you program without being able to read them?) and it makes it
difficult for _us_ to discuss because we don't know if you meant chair or
table when you said sofa.
Don't get me wrong, everyone started somewhere some time ago. But if you
want to communicate with other programmers (or even just program for
yourself) you better learn the terms of the trade or communication will be
severely confused.

jue




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

Date: Sun, 17 Aug 2003 14:57:01 GMT
From: Juha Laiho <Juha.Laiho@iki.fi>
Subject: Re: CGI is not so hard
Message-Id: <bho4uf$4i2$1@ichaos.ichaos-int>

scripts_you_know_the_drill_@hudsonscripting.com said:
>On Sun, 17 Aug 2003 00:51:45 GMT, "David Formosa (aka ? the Platypus)"
><dformosa@dformosa.zeta.org.au> wrote:
>
>>On Sat, 16 Aug 2003 02:09:15 -0700, Hudson
>><scripts_you-know-the-drill_@hudsonscripting.com> wrote: 
>>
>>> ok...I have really had it with this group...I think this is lame
>>> that you all don't know http or cgi or soap and can only think in
>>> modules.

You've already shown that you don't even know the area of HTTP/CGI as
well as the author of the CGI module does, so you've managed to prove
the point of using the modules.

>yes...but it is so cool to know soap or http and it is really pretty
>simple...just read one or two RFC's and something about soap and then
>you can interface all you want via IO::Socket

Yes, the basic model in those is easy. Yet there are quite a list of
details to remember (the separator character in CGI param lists being
one of them). And to make your program work correctly, you'll have to
get all those details correct.

Also, if it so happens that to get something done, you're only allocated
three hours time, you don't want to spend any time on such pieces of
code that you know someone else has already written (and that have
been widely tested in various of real-life conditions). And definitely
you don't want to end up writing code for all those details again and
again for each of your projects. So, this boils down to writing [and
MAINTAINING!] your own module to implement some functionality (or making
a cut-n-paste of code implementing some functionality) when you're
writing code for some new project where that functionality is needed.

Now, consider a situation where you have done this your own way; having
few hundreds of CGI programs around, each having the CGI functionality
copied from one of the others, but slightly modified, as you realized it
didn't quite work correctly for this specific case. Perhaps even the CGI
functionality is partly intermixed with your application logic, because
you could that way optimize away one variable and three operations.

Then something in the specifications change (like the change from &-
delimited param lists to ;-delimited ones). What do you do to make your
scripts compliant with this change? You hand-edit each of the scripts.
What does the "dumb" programmer who used the module? He replaces the
module, once per each machine where he has those scripts running. With
bad luck there may be couple of scripts that did depend on some detail
of the module interface that did change along with the other changes in
the module, but that's the extent of the change.


One important measure of programmer ability is the maintainability of
the produced code (don't know about you, but in the real life code
is written to be used and modified, not to be thrown away). Modules
inherently improve maintainability, so avoiding the use of them is a
very worrying sign in a programmer.

Of course, if you can show that a module is so badly implemented that
you can do the same thing better, then it's good to have a discussion
with the author of that module, providing your insights and proposals
for improvement -- or even writing a competing module, if the author
doesn't like to implement your proposed changes.

Writing small pieces of throwaway code to learn how some things work
(like for learning CGI), is just fine. But that doesn't give any grounds
for starting a crusade against use of modules, and there's no reason
to brag that you're so smart you can do something that can also be
achieved by a module (especially when you in the same message claim
that what the module does is trivial - and later still show you don't
know the details of even those trivialities). And as the module (with
the details implemented correctly) already existed, you weren't even
creating anything new.

I also did my own code testing to learn/verify some issues of the CGI.
After satisfying my curiosity (and after starting to write real code
where CGI was needed), I switched over to use the module. This is "best
of both worlds" solution: I'm not wasting my time (nor that of my
employer) reimplementing and maintaining something someone else already
does. Still when it is needed, I also know the underlying technology
(which, as you say, is not hard).
-- 
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, 17 Aug 2003 11:15:11 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: comp.lang.perl.open.discussion rfc in alt.config
Message-Id: <3tJ%a.4$Yx6.61@news.dircon.co.uk>

hudson <scripts_you_know_the_drill_@hudsonscripting.com> wrote:
> On Sun, 17 Aug 2003 05:20:59 +0000 (UTC), "David H. Adler"
> <dha@panix.com> wrote:
> 
>>From what I've been reading of your posts, you seem to be wanting not
>>open discussion - which is what happens on clpmisc - but discussion that
>>involves not telling people that you think they're doing something
>>wrong.
> 
> don't give me BS...what is happening on a.l.p.misc is not open
> discussion but zombie talk and dogma...isn't that true???

Er, no.  There is certainly a degree of received opinion and convention
but that is true of wider social communities as much as this newsgroup.

The opinions that you seem to disagree with here are not just things
invented by people in this newsgroup to poke at newcomers but are the
accepted standards that you will find reflected anywhere that (mainstream)
Perl is discussed.  Sure you may find places on the 'net where you might
find your opinion confirmed, you will also find that in most of these
places people (some of whom are active in this newsgroup and some who aren't)
 who are more in touch with mainstream practice will do their best to rebutt
bad suggestions.

I'm sure that if you were yourself open to discussion on these matters, you
could probably get a pretty good discussion on the reasons why these
accepted standards and practice are so. Most standards and conventions are
open for challenge but you are going to have do a little more than insulting
the people advocating them if you actually want some discussion on the
matter.

HTH

/J\
-- 
Jonathan Stowe                      |
<http://www.gellyfish.com>          |      This space for rent
                                    |


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

Date: Sun, 17 Aug 2003 14:47:14 GMT
From: jtbellq2f@presby.edu (Jon Bell)
Subject: Re: comp.lang.perl.open.discussion rfc in alt.config
Message-Id: <HJrqEq.CD2@presby.edu>

In article <jukujvoo4oqqfomtd7eq33v55i77ldrfr5@4ax.com>,
hudson  <scripts_you_know_the_drill_@hudsonscripting.com> wrote:
>On Sun, 17 Aug 2003 05:20:59 +0000 (UTC), "David H. Adler"
><dha@panix.com> wrote:
>
>>Additionally, I note that alt.config would be an inappropriate place for
>>discussion of the creation of a group with the name you suggest.
>
>why? alt.config is where you create newsgroups...right?

Only for alt groups.  

See <http://web.presby.edu/~nnqadmin/nnq/ncreate.html>.

-- 
Jon Bell <jtbellap8@presby.edu>                     Presbyterian College
Dept. of Physics and Computer Science        Clinton, South Carolina USA


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

Date: Sun, 17 Aug 2003 12:40:43 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Extremely Basic mySQL question.
Message-Id: <fJK%a.8$Yx6.647@news.dircon.co.uk>

In comp.lang.perl.misc Ivan Marsh <annoyed@you.now> wrote:
> On Wed, 13 Aug 2003 00:05:33 +0000, Tyler Cruz wrote:
> 
> > Hi,
> > 
> > I was wondering how should I download the mySQL dump to my computer via
> > FTP? ASCII or binary? Or does it matter?
> > 
> > Thanks a lot,
> > 
> > Tyler
> 
> Typically all FTP transfers are binary these days. There's no reason, that
> I know of anyway, to use ASCII transfer specificly.
> 

So when the manpage for ftp client says:

     type [type-name]
                 Set the file transfer type to type-name. If no type is speci­
                 fied, the current type is printed.  The default type is net­
                 work ASCII.


it is lying then?  Right.

/J\
-- 
Jonathan Stowe                      |
<http://www.gellyfish.com>          |      This space for rent
                                    |


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

Date: Sun, 17 Aug 2003 23:11:26 +1200
From: "Tintin" <me@privacy.net>
Subject: Re: file upload in cgi
Message-Id: <bhno3t$1ansj$1@ID-172104.news.uni-berlin.de>


"Hudson" <scripts_you-know-the-drill_@hudsonscripting.com> wrote in message
news:bhprjvok773hasvlrngbdug10vp9r7mumm@4ax.com...
> very easy...I did it yesterday...if a file is over x bytes, stop the
transfer
> and unlink the file...what's so hard?

Did you use you CGI parsing code that you previously posted to do the job?




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

Date: Sun, 17 Aug 2003 11:48:06 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: how to rename 200 files in many sub-directories?
Message-Id: <WXJ%a.6$Yx6.460@news.dircon.co.uk>

Geoff Cox <geoff.cox@blueyonder.co.uk> wrote:
> On Sun, 17 Aug 2003 18:44:08 +1000, "Gregory Toomey"
> <NOSPAM@bigpond.com> wrote:
> 
> >"Geoff Cox" <geoff.cox@blueyonder.co.uk> wrote in message
> >news:89fujvcs00g1bl19g20m601189nm479nbf@4ax.com...
> >> Hello,
> >>
> >> I have over 200 zip files in about 100 sub-directories of say c:\docs.
> >...
> >
> >You can use Archive::Zip in Perl to manipulate the zip files.
> >
> 
> Thanks for info - can I use this with Perl under Windows 98 (SE) ?
> 

I believe that it is actually included as standard with the activestate
Perl distribution - if not (I don't have a windows machine handy to check)
it *is* available for installation with PPM.

/J\
-- 
Jonathan Stowe                      |
<http://www.gellyfish.com>          |      This space for rent
                                    |


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

Date: Sun, 17 Aug 2003 12:07:43 GMT
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: how to rename 200 files in many sub-directories?
Message-Id: <3F3F6FF9.613FD8D3@acm.org>

Geoff Cox wrote:
> 
> I have over 200 zip files in about 100 sub-directories of say c:\docs.
> 
> Each zip file contains one MS Word doc file. The name of the doc file
> is different from that of its parent zip file.
> 
> I would like to run wzunzip.exe (command line version of WinZip) to
> expand each zip file, rename the doc file to name of its zip file and
> then delete the zip file....
> 
> I need to loop through the sub-directories, expanding each zip file,
> renaming the doc file produced and deleting the zip file, in each
> sub-directory. I guess I need to put the name of the zip file into a
> variable so that after running wzunzip.exe I can then rename the doc
> file produced etc etc...
> 
> Any ideas please!

Something like this (untested):

use warnings;
use strict;

use File::Find:

my $dir = 'c:/docs';
# The -p option from Info-ZIP's unzip sends file data to stdout.
# It may not be the same in WinZIP's wzunzip
my $unzip = 'wzunzip.exe -p';

find( sub {
    ( my $name = $_ ) =~ s/\.zip$/.doc/i or return;
    open my $doc, '>', $name or die "Cannot open $name: $!";
    binmode $doc;
    print $doc qx( "$unzip $_" ) or die "Cannot print to $name: $!";
    unlink $_ or warn "Cannot delete $_: $!";
    }, $dir );

__END__



John
-- 
use Perl;
program
fulfillment


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

Date: Sun, 17 Aug 2003 13:20:44 GMT
From: "Ian.H [dS]" <ian@WINDOZEdigiserv.net>
Subject: Re: how to rename 200 files in many sub-directories?
Message-Id: <20030817142049.1156256d.ian@WINDOZEdigiserv.net>

On Sun, 17 Aug 2003 11:48:06 GMT in
<message-id:WXJ%a.6$Yx6.460@news.dircon.co.uk>
Jonathan Stowe <gellyfish@gellyfish.com> wrote:

>  > >You can use Archive::Zip in Perl to manipulate the zip files.
>  > >
>  > 
>  > Thanks for info - can I use this with Perl under Windows 98 (SE) ?
>  > 
> 
>  I believe that it is actually included as standard with the
>  activestate Perl distribution - if not (I don't have a windows
>  machine handy to check) it *is* available for installation with PPM.


Yup.. can vouch for that J.. just ditched my 2k box here.. but have
happily used Archive::Zip and Archive::Tar on it for some time.. both
came with AS Perl.



Regards,

  Ian

-- 
Ian.H [Design & Development]
digiServ Network - Web solutions
www.digiserv.net | irc.digiserv.net | forum.digiserv.net
Programming, Web design, development & hosting.


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

Date: Sun, 17 Aug 2003 08:11:30 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: how to rename 200 files in many sub-directories?
Message-Id: <slrnbjuvo2.kqi.tadmc@magna.augustmail.com>

Geoff Cox <geoff.cox@blueyonder.co.uk> wrote:

> I would like to run wzunzip.exe 


   perldoc -f system


> rename the doc file 


   perldoc -f rename


> then delete the zip file....


   perldoc -f unlink


> I need to loop through the sub-directories


   use File::Find;


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


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

Date: Sun, 17 Aug 2003 23:21:24 +1200
From: "Tintin" <me@privacy.net>
Subject: Re: Hudson River
Message-Id: <bhnocu$1a3d7$1@ID-172104.news.uni-berlin.de>


"Gunnar Hjalmarsson" <noreply@gunnar.cc> wrote in message
news:bhl0al$dm3u$1@ID-184292.news.uni-berlin.de...
> I'm not impressed by Hudson's way to make his point(s). At the same
> time, I just don't understand why the regulars, who so strongly
> advocate the use of modules in general and CGI.pm in particular,
> provoke such reactions over and over again. It's a mystery to me why
> some people here make such a fuss about the fact that some of us
> sometimes choose to parse form data using a few lines of own code
> instead of using CGI.pm. You are lousy missionaries. ;-)

The main point (and it's been made many, many times) is that posting bad
code has consequences later on when Joe newbie does a Google search, finds a
piece of code which appears to work for them and they start using it
production code.

How many times have you heard, "I found this piece of Perl code.  I don't
understand how it does it, but it works well for me."  That is, it works
well until its bugs/incompatibilities rear their nasty head after the
environment or data it's running under changes.




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

Date: Sun, 17 Aug 2003 14:49:06 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Hudson River
Message-Id: <bhntk8$1ak8t$1@ID-184292.news.uni-berlin.de>

Tintin wrote:
> The main point (and it's been made many, many times) is that
> posting bad code has consequences later on when Joe newbie does a
> Google search, finds a piece of code which appears to work for them
> and they start using it production code.

Is that the main point?

I don't defend the use of "bad" code. But I do reserve me the right to
use code that does what I need it to do in *my* program, even if it
wouldn't work in anybody else's programs.

> How many times have you heard, "I found this piece of Perl code.  I
> don't understand how it does it, but it works well for me."  That
> is, it works well until its bugs/incompatibilities rear their nasty
> head after the environment or data it's running under changes.

Let's say that I use this regex:

     if ( /abc\sxyz/ )

Somebody might object and say:
"It won't match unless 'abc' and 'xyz' are separated by exactly one
space, so you'd better do /abc\s*xyz/."

But if I explain the context in *my* program, letting him/her know
that I *know* that they are always separated by one space, my
explanation would probably be accepted.

Now, let's say that I have some code that deals with form data from
STDIN, including:

     for (split /&/, $data)

If I would post it here, somebody would most certainly claim it to be
broken since I don't include ';' when splitting.

Then, if I would explain that in *my* program, data is only submitted
from a form using the POST method, some people here would *not* accept
my explanation, but still claim that the code is "broken", refer to
"Joe newbie" etc.

So, what's the difference between these two examples? Well, there is
absolutely no rational reason for claiming that there is a difference.
The simple explanation is that the latter example has to do with
something that *might* be done by help of CGI.pm, and for some
inscrutable reason CGI.pm has been made a 'sacred cow'.

Sacred cows should be slaughtered. Doing so make things *so* much
easier.

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



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

Date: Sun, 17 Aug 2003 23:23:31 +1200
From: "Tintin" <me@privacy.net>
Subject: Re: In My Humble Opinion...
Message-Id: <bhnogt$1a9p0$1@ID-172104.news.uni-berlin.de>


"hudson" <scripts_you_know_the_drill_@hudsonscripting.com> wrote in message
news:k60ujvouhnrfjmtpvl4bolh1edh2k172ju@4ax.com...
> On Sat, 16 Aug 2003 20:45:37 -0400, Chesucat <chesucat@freeshell.org>
> wrote:
>
> >You people are all a bunch of assholes!  Perl sucks!  Python rules!;-)
> >
> >chesucat
>
> hey...are the people nicer in python newsgroups?

Ooohh  YES!




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

Date: Sun, 17 Aug 2003 12:22:39 +0100
From: "Bob Welton" <welton_bob@nospam_hotmail.com>
Subject: Re: mod_perl 2 Setup ?
Message-Id: <bhnoqa$uh$1@news.freedom2surf.net>

Thanks Sam,

conf.d was All OK but still the site is very slow.

Should     # httpd -l    list  ' mod_perl.c'  as a compiled module with
mod_perl 2 ?

Any other suggestions as what may be wrong ?

"sam" <rbaba99@caramail.com> wrote in message
news:bhnivm$2tv6$1@news.cybercity.dk...
> Check in your /etc/httpd/conf.d/ if you have a file named perl.conf
> If so, if the dirctives LoadModule, Alias and Directory are commented,
> uncomment them
> and edit the Alias and Directory directives to suite your need.
> If no, create it and add this:
>
> LoadModule perl_module modules/mod_perl.so
>
> Alias /perl /var/www/perl
> <Directory /var/www/perl>
>  SetHandler perl-script
>  PerlHandler ModPerl::Registry::handler
>  PerlOptions +ParseHeaders
>  Options +ExecCGI
> </Directory>
>
> save it and restart your web server with these command:
>
> > service httpd stop
> > service httpd start
>
> And now you have mod_perl enabled on apache 2.
>
>
>
> Hope this helps
>
>
> "Bob Welton" <welton_bob@nospam_hotmail.com> wrote in message
> news:bhnaet$q4c$1@news.freedom2surf.net...
> > I am running Red Hat 9 that  has Apache 2 installed with the build. I
have
> > been trying to set up mod_perl 2 but have had lots of problems and don't
> > think its working. How can I check if its installed ?
> >
> > I have tried   # httpd -l  and get:
> > Compiled in modules:
> >   core.c
> >   prefork.c
> >   http_core.c
> >   mod_so.c
> >
> > Should mod_perl appear here in version 2 ?
> >
> > I'm pretty new to Linux, so take it easy on me.
> >
> > Many thanks
> >
> > Bob
> >
> >
>
>




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

Date: Sun, 17 Aug 2003 13:11:15 +0100
From: "Bob Welton" <welton_bob@nospam_hotmail.com>
Subject: Re: mod_perl 2 Setup ?
Message-Id: <bhnrlg$28e$1@news.freedom2surf.net>

mmm can I clarify: Where should the 'Alias' and '<Directory' point to ?

If I point them to my index.pl   I get a server error 500
If I point them to the directories where my application is loaded i.e where
the  '####.pm' exist it loads pages, but is not too quick.

Many thanks

"Bob Welton" <welton_bob@nospam_hotmail.com> wrote in message
news:bhnoqa$uh$1@news.freedom2surf.net...
> Thanks Sam,
>
> conf.d was All OK but still the site is very slow.
>
> Should     # httpd -l    list  ' mod_perl.c'  as a compiled module with
> mod_perl 2 ?
>
> Any other suggestions as what may be wrong ?
>
> "sam" <rbaba99@caramail.com> wrote in message
> news:bhnivm$2tv6$1@news.cybercity.dk...
> > Check in your /etc/httpd/conf.d/ if you have a file named perl.conf
> > If so, if the dirctives LoadModule, Alias and Directory are commented,
> > uncomment them
> > and edit the Alias and Directory directives to suite your need.
> > If no, create it and add this:
> >
> > LoadModule perl_module modules/mod_perl.so
> >
> > Alias /perl /var/www/perl
> > <Directory /var/www/perl>
> >  SetHandler perl-script
> >  PerlHandler ModPerl::Registry::handler
> >  PerlOptions +ParseHeaders
> >  Options +ExecCGI
> > </Directory>
> >
> > save it and restart your web server with these command:
> >
> > > service httpd stop
> > > service httpd start
> >
> > And now you have mod_perl enabled on apache 2.
> >
> >
> >
> > Hope this helps
> >
> >
> > "Bob Welton" <welton_bob@nospam_hotmail.com> wrote in message
> > news:bhnaet$q4c$1@news.freedom2surf.net...
> > > I am running Red Hat 9 that  has Apache 2 installed with the build. I
> have
> > > been trying to set up mod_perl 2 but have had lots of problems and
don't
> > > think its working. How can I check if its installed ?
> > >
> > > I have tried   # httpd -l  and get:
> > > Compiled in modules:
> > >   core.c
> > >   prefork.c
> > >   http_core.c
> > >   mod_so.c
> > >
> > > Should mod_perl appear here in version 2 ?
> > >
> > > I'm pretty new to Linux, so take it easy on me.
> > >
> > > Many thanks
> > >
> > > Bob
> > >
> > >
> >
> >
>
>




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

Date: Sun, 17 Aug 2003 11:42:25 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Newbie Formhandler
Message-Id: <BSJ%a.5$Yx6.460@news.dircon.co.uk>

simonis <simonis@myself.com> wrote:
> Greg wrote:
> > 
> > I'm looking for a form handler script that will take what ever is
> > entered in textbox 1 (there will be multiple textboxes) and use it
> > for a txt filename.  I would also need spaces in the name converted
> > to underscores and if a file already exists with the same filename is
> > it possible to either see if the contents are the same or give the
> > new file a 1 or something like that in front of the filename?. I'm
> > not worried about E-mail, just the txt file and a thank you page.
> > Has anyone see this?
> 
> 
> There are myriad form handlers out there on the Internet, a quick 
> search of Google would have shown you this.  
> 
> http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=example+form+handler
> 

Whilst I would in general agree with the 'help yourself' approach to this
question, I think it would be best to point out that the majority of the
examples that this search brings up are utterly appalling and as I would
guess that the OP has no way of discerning the wheat from the chaff it might
be worth suggesting that he first start by reading:

   http://www.perl.com/pub/a/2002/01/23/cgi.html

and then suggesting reading the documentation for the CGI module at:

   http://search.cpan.org/src/LDS/CGI.pm-2.99/cgi_docs.html

HTH

/J\
-- 
Jonathan Stowe                      |
<http://www.gellyfish.com>          |      This space for rent
                                    |


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

Date: Sun, 17 Aug 2003 10:54:53 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: perl hacking for fun and pleasure
Message-Id: <1aJ%a.3$Yx6.286@news.dircon.co.uk>

Tony Curtis <tony_curtis32@yahoo.com> wrote:
>>> On Sat, 16 Aug 2003 22:03:29 -0700,
>>> hudson <scripts_you_know_the_drill_@hudsonscripting.com> said:
> 
>> On Sun, 17 Aug 2003 11:19:46 +1000, "Gregory Toomey"
>> <NOSPAM@bigpond.com> wrote:
> 
>>> If you dont want to use cgi.pm, you can probably get
>>> away with http://cgi-lib.berkeley.edu/ instead.  I
>>> often use cgi-lib.pl as it takes a lot less time to
>>> load, and with cgi response time can be important.
> 
>> Hey...thanks Greg!
> 
>> From the website:
> 
>> "The cgi-lib.pl library has become the de facto standard
>> library for creating Common Gateway Interface (CGI)
>> scripts in the Perl language."
> 
> Now look at the modification date at the bottom...
> 

It might also be noted that as CGI.pm has been in the core Perl
distribution since 1997, one doesn't need to download and install
any additional software to use it.

/J\
-- 
Jonathan Stowe                      |
<http://www.gellyfish.com>          |      This space for rent
                                    |


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

Date: Sun, 17 Aug 2003 13:09:47 +0000 (UTC)
From: "Jerry Maguire" <jamesbond_422@hotmail.com>
Subject: simple perl script
Message-Id: <bhnuqq$aau$1@titan.btinternet.com>

Hi,
I would like to write a perl script to open and file and add a prefix to all
the lines of that file.
The file will be like:

name1blah
name2blah
name3blah

I have created the following script:
#!/bin/sh
cat test |
while read name
do
printf 'new'$name>>newfile.txt;
done

Now the problem is it is adding all the lines in one line.
The output is:
newname1blahnewname2blahnewname3blah

jerry





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

Date: Sun, 17 Aug 2003 09:48:17 -0400
From: Shawn Corey <shawn@magma.ca>
Subject: Re: simple perl script
Message-Id: <8nednZdi0sXFGqKiXTWJkQ@magma.ca>



perl -ple '$_="new$_"'


Jerry Maguire wrote:
> Hi,
> I would like to write a perl script to open and file and add a prefix to all
> the lines of that file.
> The file will be like:
> 
> name1blah
> name2blah
> name3blah
> 
> I have created the following script:
> #!/bin/sh
> cat test |
> while read name
> do
> printf 'new'$name>>newfile.txt;
> done
> 
> Now the problem is it is adding all the lines in one line.
> The output is:
> newname1blahnewname2blahnewname3blah
> 
> jerry
> 
> 
> 



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

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


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