[30346] in Perl-Users-Digest
Perl-Users Digest, Issue: 1589 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu May 29 21:09:59 2008
Date: Thu, 29 May 2008 18:09:22 -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 Thu, 29 May 2008 Volume: 11 Number: 1589
Today's topics:
Can't locate object method is_initial_req <jcharth@gmail.com>
Re: FAQ 5.12 How can I open a filehandle to a string? <hjp-usenet2@hjp.at>
Re: FAQ 5.12 How can I open a filehandle to a string? <hjp-usenet2@hjp.at>
Re: FAQ 5.12 How can I open a filehandle to a string? <bill@ts1000.us>
Re: How to make input user and password in perl script <bill@ts1000.us>
How to make input user and password in perl script star <pero@tupwerwt.ch>
Re: How to make input user and password in perl script <jurgenex@hotmail.com>
Re: IPC::Shareable. Does it work? <reply_in_group@mouse-potato.com>
Re: Need help with a simple (I think) Perl script <tzz@lifelogs.com>
Re: Need help with a simple (I think) Perl script <1usa@llenroc.ude.invalid>
Re: Need help with a simple (I think) Perl script <1usa@llenroc.ude.invalid>
Re: Need help with a simple (I think) Perl script <t@ge.vinalid>
Re: Need help with a simple (I think) Perl script <benkasminbullock@gmail.com>
Re: Need help with a simple (I think) Perl script <na@clpm.dilavni>
Re: Need help with a simple (I think) Perl script <bill@ts1000.us>
Re: Need help with a simple (I think) Perl script <noreply@gunnar.cc>
Re: Need help with a simple (I think) Perl script <szrRE@szromanMO.comVE>
Re: Need help with a simple (I think) Perl script <bill@ts1000.us>
Re: Need help with a simple (I think) Perl script <rsutton43@comcast.net>
Re: Need help with a simple (I think) Perl script <noreply@gunnar.cc>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 29 May 2008 14:05:07 -0700 (PDT)
From: joe <jcharth@gmail.com>
Subject: Can't locate object method is_initial_req
Message-Id: <28b8b4b8-f56f-4858-91ea-09b24f5d1dea@z72g2000hsb.googlegroups.com>
Hello I am using AuthDBI with apache and I keep getting this error.
Can't locate object method "is_initial_req" via package
"Apache2::RequestRec
I searched for is_initial_req and found the following
site_perl/5.8.5/Apache/AuthDBI.pm: $type .= 'initial ' if $r-
>is_initial_req();
site_perl/5.8.5/Apache/AuthDBI.pm: $type .= 'initial ' if $r-
>is_initial_req;
site_perl/5.8.5/Apache/AuthDBI.pm: unless $r->is_initial_req; #
only the first internal request
site_perl/5.8.5/Apache/AuthDBI.pm: $type .= 'initial ' if $r-
>is_initial_req();
site_perl/5.8.5/Apache/AuthDBI.pm: $type .= 'initial ' if $r-
>is_initial_req;
site_perl/5.8.5/Apache/AuthDBI.pm: unless ($r->is_initial_req) {
Binary file site_perl/5.8.5/i386-linux-thread-multi/auto/Apache2/
RequestUtil/RequestUtil.so matches
site_perl/5.8.5/i386-linux-thread-multi/Apache2/RequestUtil.pm:
$is_initial = $r->is_initial_req();
site_perl/5.8.5/i386-linux-thread-multi/Apache2/RequestUtil.pm:=head2
C<is_initial_req>
site_perl/5.8.5/i386-linux-thread-multi/Apache2/RequestUtil.pm:
$is_initial = $r->is_initial_req();
site_perl/5.8.5/i386-linux-thread-multi/Apache2/RequestRec.pm:C<L<$r-
E<gt>is_initial_req|docs::2.0::api::Apache2::RequestUtil/
C_is_initial_req_>>.
site_perl/5.8.5/i386-linux-thread-multi/Apache2/SizeLimit.pm: if
($r->is_initial_req()) {
site_perl/5.8.5/i386-linux-thread-multi/ModPerl/
MethodLookup.pm: 'is_initial_req' => [
Any ideas?
THanks.
------------------------------
Date: Thu, 29 May 2008 23:57:50 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: FAQ 5.12 How can I open a filehandle to a string?
Message-Id: <slrng3u9mu.t8u.hjp-usenet2@hrunkner.hjp.at>
On 2008-05-26 19:03, PerlFAQ Server <brian@stonehenge.com> wrote:
> --------------------------------------------------------------------
>
> 5.12: How can I open a filehandle to a string?
>
> , , ,
I think the commas in
| X<string>, X<open>, X<IO::Scalar>, X<filehandle>
should be omitted.
> (contributed by Peter J. Holzer, hjp-usenet2@hjp.at)
>
> Since Perl 5.8.0, you can pass a reference to a scalar instead of the
> filename to create a file handle which you can used to read from or
> write to a string:
Yikes! Did I really create that monster of a sentence (not to mention
the typo)? I guess it shows that German is my native language. How about
this?
| Since Perl 5.8.0 a file handle referring to a string can be created by
| calling open with a reference to that string instead of the filename.
| This file handle can then be used to read from or write to the string:
hp
------------------------------
Date: Fri, 30 May 2008 00:15:13 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: FAQ 5.12 How can I open a filehandle to a string?
Message-Id: <slrng3uanj.t8u.hjp-usenet2@hrunkner.hjp.at>
On 2008-05-26 20:46, brian d foy <brian.d.foy@gmail.com> wrote:
> In article
><6669364b-16cb-4252-b0c7-8ab49bf242af@26g2000hsk.googlegroups.com>,
> Bill H <bill@ts1000.us> wrote:
>
>> [snip]
>> > 5.12: How can I open a filehandle to a string?
>
>> This is interesting, but what real world examples would there be to
>> doing this instead of just using string functions?
>
> I usually need this where some module insists on having a filehandle to
> send its data to, but I want it in a string without all the extra work
> and left-over files. Now I can print to a string directly.
I find this especially handy in test scripts. For example, here's an
excerpt from a test script for a project I'm currently working on:
my $s;
close(STDOUT);
my $id = $dataset->id;
open(STDOUT, '>', \$s);
$dataset->print('xml');
ok(index($s, "<d:id>$id</d:id>") != -1, "generated XML contains <d:id>$id</d:id>");
ok(index($s, "<d:description xml:lang='de'") != -1, "generated XML contains german description");
(in this case $dataset also has a method as_xml, which returns the XML
representation as a string. So this test mainly serves to ensure that
print really calls as_xml and prints the result to STDOUT. But it might
actually be useful to turn them around: Put all the logic into print and
then implement as_xml as a wrapper around print - this safes memory when
you are only printing and allows pipeling the produces and the consumer
of the XML file)
hp
------------------------------
Date: Thu, 29 May 2008 15:42:19 -0700 (PDT)
From: Bill H <bill@ts1000.us>
Subject: Re: FAQ 5.12 How can I open a filehandle to a string?
Message-Id: <7135d335-a702-48cc-8ee2-d0e00853615e@56g2000hsm.googlegroups.com>
On May 29, 6:15=A0pm, "Peter J. Holzer" <hjp-usen...@hjp.at> wrote:
> On 2008-05-26 20:46, brian d foy <brian.d....@gmail.com> wrote:
>
> > In article
> ><6669364b-16cb-4252-b0c7-8ab49bf24...@26g2000hsk.googlegroups.com>,
> > Bill H <b...@ts1000.us> wrote:
>
> >> [snip]
> >> > 5.12: How can I open a filehandle to a string?
>
> >> This is interesting, but what real world examples would there be to
> >> doing this instead of just using string functions?
>
> > I usually need this where some module insists on having a filehandle to
> > send its data to, but I want it in a string without all the extra work
> > and left-over files. Now I can print to a string directly.
>
> I find this especially handy in test scripts. For example, here's an
> excerpt from a test script for a project I'm currently working on:
>
> my $s;
> close(STDOUT);
>
> my $id =3D $dataset->id;
>
> open(STDOUT, '>', \$s);
> $dataset->print('xml');
> ok(index($s, "<d:id>$id</d:id>") !=3D -1, =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
"generated XML contains <d:id>$id</d:id>");
> ok(index($s, "<d:description xml:lang=3D'de'") !=3D -1, =A0 =A0 "generated=
XML contains german description");
>
> (in this case $dataset also has a method as_xml, which returns the XML
> representation as a string. So this test mainly serves to ensure that
> print really calls as_xml and prints the result to STDOUT. But it might
> actually be useful to turn them around: Put all the logic into print and
> then implement as_xml as a wrapper around print - this safes memory when
> you are only printing and allows pipeling the produces and the consumer
> of the XML file)
>
> =A0 =A0 =A0 =A0 hp
I like this idea Peter. I am starting to do a lot of xml processing
via perl and this may come in handy.
Thanks, Bill H
------------------------------
Date: Thu, 29 May 2008 15:54:59 -0700 (PDT)
From: Bill H <bill@ts1000.us>
Subject: Re: How to make input user and password in perl script started on web?
Message-Id: <b9ec4458-b03d-49b6-a562-916ce9b06a63@e53g2000hsa.googlegroups.com>
On May 29, 5:24=A0pm, J=FCrgen Exner <jurge...@hotmail.com> wrote:
> "Pero" <p...@tupwerwt.ch> wrote:
> >How to make input user and password in perl script
>
> This Question is Asked Frequently: perldoc -q password
> =A0 =A0 =A0 =A0 "How do I ask the user for a password?"
>
> >started on web?
>
> This Question is also Asked Frequently: perldoc -q password
> =A0 =A0 =A0 =A0 "How do I put a password on my web pages?"
>
> jue
Or on the web if you sitting in your living room away from perldoc
like me (I had to see if perldoc.perl.org worked like perldoc -q and
it does :) ):
http://perldoc.perl.org/perlfaq8.html#How-do-I-ask-the-user-for-a-password%3=
F
http://perldoc.perl.org/perlfaq9.html#How-do-I-put-a-password-on-my-web-page=
s%3F
And just so you know, neither one really tells you how, they tell you
it has nothing to do with perl.
Bill H
------------------------------
Date: Thu, 29 May 2008 22:15:56 +0200
From: "Pero" <pero@tupwerwt.ch>
Subject: How to make input user and password in perl script started on web?
Message-Id: <g1n2tu$c42$1@localhost.localdomain>
How to make input user and password in perl script started on web?
Pero
------------------------------
Date: Thu, 29 May 2008 21:24:12 GMT
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: How to make input user and password in perl script started on web?
Message-Id: <eh7u341qauav21tk9antv6esvkj3453q6g@4ax.com>
"Pero" <pero@tupwerwt.ch> wrote:
>How to make input user and password in perl script
This Question is Asked Frequently: perldoc -q password
"How do I ask the user for a password?"
>started on web?
This Question is also Asked Frequently: perldoc -q password
"How do I put a password on my web pages?"
jue
------------------------------
Date: Thu, 29 May 2008 17:56:51 -0700
From: Tim Smith <reply_in_group@mouse-potato.com>
Subject: Re: IPC::Shareable. Does it work?
Message-Id: <reply_in_group-000979.17565129052008@news.supernews.com>
Thanks for the suggestions.
One of the systems did have PostgreSQL running. Stopping that didn't
help, and that was the only thing using SysV IPC objects.
All I really *need* is to share one string between processes, so I'll
just handle it myself with shmget, shmread, and shmwrite, and
IPC::Semaphore for coordination. Each process only uses the shared
string a couple of times, so having to explicitly copy it to and from
shared memory won't be much of a hassle.
--
--Tim Smith
------------------------------
Date: Thu, 29 May 2008 14:53:08 -0500
From: Ted Zlatanov <tzz@lifelogs.com>
Subject: Re: Need help with a simple (I think) Perl script
Message-Id: <86od6oga57.fsf@lifelogs.com>
On 29 May 2008 12:08:32 -0500 Lawrence Statton <yankeeinexile@gmail.com> wrote:
LS> "Dick Sutton" <rsutton43@comcast.net> writes:
>>
>> First of all, I did declare $Year and $Month in my original post.
>>
LS> No, you did not.
>> # get the parameters...
>> $year = param('Year');
LS> Here you define $year. Not $Year.
>> $month = param('Month');
LS> Ditto.
>> I do not need help from such as you.
LS> Welcome to the world of killfiles.
Did it perhaps occur to you that not everyone knows Perl variable names
are case-sensitive, and that not every programming language is like
Perl?
You and A. Sinan Unur are being nasty when a quick look at the original
script would have been sufficient to understand the miscommunication.
This obstinate need to insult someone because they don't know your
particular shibboleth reflects badly on the Perl community.
Ted
------------------------------
Date: Thu, 29 May 2008 21:05:15 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Need help with a simple (I think) Perl script
Message-Id: <Xns9AADADD1E26Dasu1cornelledu@127.0.0.1>
Ted Zlatanov <tzz@lifelogs.com> wrote in
news:86od6oga57.fsf@lifelogs.com:
> On 29 May 2008 12:08:32 -0500 Lawrence Statton
> <yankeeinexile@gmail.com> wrote:
>
> LS> "Dick Sutton" <rsutton43@comcast.net> writes:
>>>
>>> First of all, I did declare $Year and $Month in my original post.
>>>
> LS> No, you did not.
>
>>> # get the parameters...
>>> $year = param('Year');
>
> LS> Here you define $year. Not $Year.
>
>>> $month = param('Month');
>
> LS> Ditto.
>
>>> I do not need help from such as you.
>
> LS> Welcome to the world of killfiles.
>
> Did it perhaps occur to you that not everyone knows Perl variable
> names are case-sensitive, and that not every programming language is
> like Perl?
>
> You and A. Sinan Unur are being nasty when a quick look at the
> original script would have been sufficient to understand the
> miscommunication.
No.
In the original script, there is a
use strict;
line. Had that line actually been in the script rather than pasted into
the post as an after-thought, the typo would have been caught by the OP.
Hence, my belief that the poster intentionally misrepresented the
contents of the script. That is, he lied.
Sinan
--
A. Sinan Unur <1usa@llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)
comp.lang.perl.misc guidelines on the WWW:
http://www.rehabitation.com/clpmisc/
------------------------------
Date: Thu, 29 May 2008 21:12:14 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Need help with a simple (I think) Perl script
Message-Id: <Xns9AADAF0078681asu1cornelledu@127.0.0.1>
Ben Morrow <ben@morrow.me.uk> wrote in news:jkv2h5-ui4.ln1
@osiris.mauzo.dyndns.org:
> Quoth "A. Sinan Unur" <1usa@llenroc.ude.invalid>:
...
>
>> > # construct the relative pathname to the actual PDF file
>> > $pdffile = '../Library/'.$Year.$Month.'.pdf';
>>
>> You should use File::Spec->catfile.
>
> And ->updir, if you're going to do that. IMHO when the paths are that
> system-specific there's no harm in creating them directly, especially
> given how hard it is to *actually* produce portable paths with
> File::Spec (most people completely fail to handle volumes correctly).
My 'solution' to that is to make the root path a configuration variable.
I have avoided dealing with volumes for a long time with that strategy.
my $APPROOT = 'C:/www/apps/catalog';
# ...
my $pdffile = File::Spec->catfile(
$APPROOT, 'Library', "$Year$Month.pdf" );
Sinan
--
A. Sinan Unur <1usa@llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)
comp.lang.perl.misc guidelines on the WWW:
http://www.rehabitation.com/clpmisc/
------------------------------
Date: Thu, 29 May 2008 14:35:11 -0700
From: "Gordon Etly" <t@ge.vinalid>
Subject: Re: Need help with a simple (I think) Perl script
Message-Id: <6a8lshF3536h6U1@mid.individual.net>
Ted Zlatanov wrote:
> On 29 May 2008 12:08:32 -0500 Lawrence Stattonwrote:
> > "Dick Sutton" <rsutton43@comcast.net> writes:
> > > First of all, I did declare $Year and $Month in my original post.
> > No, you did not.
> > > # get the parameters...
> > > $year = param('Year');
> > Here you define $year. Not $Year.
> > > $month = param('Month');
> > Ditto.
> > > I do not need help from such as you.
> > Welcome to the world of killfiles.
> Did it perhaps occur to you that not everyone knows Perl variable
> names are case-sensitive, and that not every programming language
> is like Perl?
> You and A. Sinan Unur are being nasty when a quick look at the
> original script would have been sufficient to understand the
> miscommunication.
> This obstinate need to insult someone because they don't know your
> particular shibboleth reflects badly on the Perl community.
This is a common problem in this news group, as people like them keep
proving time and time again. Simply put, such negativity is just not
needed. If you feel you need to be nasty then it's plain better to just
move on to the next post of thread.
--
G.Etly
------------------------------
Date: Thu, 29 May 2008 21:50:59 +0000 (UTC)
From: Ben Bullock <benkasminbullock@gmail.com>
Subject: Re: Need help with a simple (I think) Perl script
Message-Id: <g1n8g3$9a7$1@ml.accsnet.ne.jp>
On Thu, 29 May 2008 21:05:15 +0000, A. Sinan Unur wrote:
> Hence, my belief that the poster intentionally misrepresented the
> contents of the script. That is, he lied.
Why you (and John Bokma, and others) endlessly insult and harass newcomers to
this newsgroup I don't know, but I don't enjoy reading it, and I wish you'd
stop it.
------------------------------
Date: Thu, 29 May 2008 15:00:57 -0700
From: "Gordon Etly" <na@clpm.dilavni>
Subject: Re: Need help with a simple (I think) Perl script
Message-Id: <6a8ncqF348ldrU1@mid.individual.net>
A. Sinan Unur wrote:
> Ted Zlatanov <tzz@lifelogs.com> wrote in
> > On 29 May 2008 12:08:32 -0500 Lawrence Statton wrote:
...
> > Did it perhaps occur to you that not everyone knows Perl variable
> > names are case-sensitive, and that not every programming language is
> > like Perl?
> > You and A. Sinan Unur are being nasty when a quick look at the
> > original script would have been sufficient to understand the
> > miscommunication.
> No.
>
> In the original script, there is a
>
> use strict;
>
> line. Had that line actually been in the script rather than pasted
> into the post as an after-thought, the typo would have been caught by
> the OP.
>
> Hence, my belief that the poster intentionally misrepresented the
> contents of the script. That is, he lied.
How typical. Just assume he lied. I suppose it also didn't occur to you
that maybe he mistakenly capitalized the those variables in that one
line by mistake? Or maybe something happened when spellchecking. It
easily could have been just a harmless mistake, yet you act like he just
lied in court and you're the judge.
--
G.Etly
------------------------------
Date: Thu, 29 May 2008 15:19:57 -0700 (PDT)
From: Bill H <bill@ts1000.us>
Subject: Re: Need help with a simple (I think) Perl script
Message-Id: <bec27717-a518-4a63-8270-851ee9ef780d@56g2000hsm.googlegroups.com>
On May 29, 5:50=A0pm, Ben Bullock <benkasminbull...@gmail.com> wrote:
> On Thu, 29 May 2008 21:05:15 +0000, A. Sinan Unur wrote:
> > Hence, my belief that the poster intentionally misrepresented the
> > contents of the script. That is, he lied.
>
> Why you (and John Bokma, and others) endlessly insult and harass newcomers=
to
> this newsgroup I don't know, but I don't enjoy reading it, and I wish you'=
d
> stop it.
Hear Hear!
Many an interesting topic has been killed by the need to disect a
post. Remember, perl is a programming language, programmers are
people. Try to keep them distinct and apply some people skills where
appropriate, and by all means, share with us your programming skills
which the vast majority of you have in excess of mine.
I was hesitant to answer the orginal post with my recommendation of
using print "location.." for fear of getting sent through the read the
faq and perldoc this and that wringer, but felt I should at least
offer my 2 cents.
Going off the ranch: I have noticed in my few years of reading this
group on a daily basis that a majority (whether large or slim) of the
questions seem to be concerning using perl in a cgi environment, but a
many of the answers to these questions seem to present solutions that
will not work in a cgi environment. For example the simple "die"
statement. If you use that in a cgi and call the perl from a web
browser you will get (or it has at least been my experience, I could
be wrong (and probably am)) a 500 internal server error.
The other suggestion of installing this or using that module, not
everyone who is programming in perl for cgi has their own server or
has the ability of adding new modules to the server (fortunatly I do)
and have to work within the capabilities of the system they are
running on. So if they post a problem and there is a solution that
wouldn't require them installing a module, recommend it, instead of
just saying use blah::blah.
Another 2 cents, makes 4 cents for the day. If I post another 198
times I will have paid for a gallon of gas.
Bill H
PS: feel free to rip this apart - but keep in mind I am a "people".
------------------------------
Date: Fri, 30 May 2008 01:16:39 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Need help with a simple (I think) Perl script
Message-Id: <6a8rt9F36u4t5U1@mid.individual.net>
Bill H wrote:
> I have noticed in my few years of reading this
> group on a daily basis that a majority (whether large or slim) of the
> questions seem to be concerning using perl in a cgi environment, but a
> many of the answers to these questions seem to present solutions that
> will not work in a cgi environment. For example the simple "die"
> statement. If you use that in a cgi and call the perl from a web
> browser you will get (or it has at least been my experience, I could
> be wrong (and probably am)) a 500 internal server error.
While I agree that questions on programs aimed to run as CGI programs
are often and unnecessarily twisted by some regulars, the example you
give is not a good one. If you develop a Perl program in a CGI
environment, you'd better make it a habit to
use CGI::Carp 'fatalsToBrowser';
It will make the browser display more meaningful error messages.
> The other suggestion of installing this or using that module, not
> everyone who is programming in perl for cgi has their own server or
> has the ability of adding new modules to the server (fortunatly I do)
> and have to work within the capabilities of the system they are
> running on. So if they post a problem and there is a solution that
> wouldn't require them installing a module, recommend it, instead of
> just saying use blah::blah.
Sometimes when people say "can't" install this or that module, they
actually mean "don't know how to". For instance, I have never heard of a
situation when a pure Perl module can't be installed, in one way or
another. So encouraging people to learn how to make use of modules is
usually the right thing to do.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Thu, 29 May 2008 17:17:50 -0700
From: "szr" <szrRE@szromanMO.comVE>
Subject: Re: Need help with a simple (I think) Perl script
Message-Id: <g1nh3e022bp@news4.newsguy.com>
Gunnar Hjalmarsson wrote:
> Bill H wrote:
[...]
>> The other suggestion of installing this or using that module, not
>> everyone who is programming in perl for cgi has their own server or
>> has the ability of adding new modules to the server (fortunatly I do)
>> and have to work within the capabilities of the system they are
>> running on. So if they post a problem and there is a solution that
>> wouldn't require them installing a module, recommend it, instead of
>> just saying use blah::blah.
>
> Sometimes when people say "can't" install this or that module, they
> actually mean "don't know how to". For instance, I have never heard
> of a situation when a pure Perl module can't be installed, in one way
> or another. So encouraging people to learn how to make use of modules
> is usually the right thing to do.
There are some modules, even pure Perl ones, that might have a
dependency on something that isn't installed, and the user is not able
to install said dependency. Or one doesn't have shell access or the
hosting account uses a Windows server (and most don't give you any sort
of shell or remote desktop access.) There can be many reasons why one
might not be able to install a module.
--
szr
------------------------------
Date: Thu, 29 May 2008 17:20:37 -0700 (PDT)
From: Bill H <bill@ts1000.us>
Subject: Re: Need help with a simple (I think) Perl script
Message-Id: <9bfaa08b-42e3-4340-85a1-fbb25f20b25f@m3g2000hsc.googlegroups.com>
On May 29, 7:16=A0pm, Gunnar Hjalmarsson <nore...@gunnar.cc> wrote:
> Bill H wrote:
> > I have noticed in my few years of reading this
> > group on a daily basis that a majority (whether large or slim) of the
> > questions seem to be concerning using perl in a cgi environment, but a
> > many of the answers to these questions seem to present solutions that
> > will not work in a cgi environment. For example the simple "die"
> > statement. If you use that in a cgi and call the perl from a web
> > browser you will get (or it has at least been my experience, I could
> > be wrong (and probably am)) a 500 internal server error.
>
> While I agree that questions on programs aimed to run as CGI programs
> are often and unnecessarily twisted by some regulars, the example you
> give is not a good one. If you develop a Perl program in a CGI
> environment, you'd better make it a habit to
>
> =A0 =A0 =A0use CGI::Carp 'fatalsToBrowser';
>
> It will make the browser display more meaningful error messages.
Gunar you are absolutly right on this. While I was typing the above I
wanted to type in "unless you use the CGI::Carp" but since I didnt
have the proper sytnax at hand I didnt want to type in the wrong
information (hence my "I could be wrong (and probably am)" :)
>
> > The other suggestion of installing this or using that module, not
> > everyone who is programming in perl for cgi has their own server or
> > has the ability of adding new modules to the server (fortunatly I do)
> > and have to work within the capabilities of the system they are
> > running on. So if they post a problem and there is a solution that
> > wouldn't require them installing a module, recommend it, instead of
> > just saying use blah::blah.
>
> Sometimes when people say "can't" install this or that module, they
> actually mean "don't know how to". For instance, I have never heard of a
> situation when a pure Perl module can't be installed, in one way or
> another. So encouraging people to learn how to make use of modules is
> usually the right thing to do.
I am sure that is the case many times. Personal experience on my end,
working with a clients hosting provider (network solutions) we needed
to install a simple Perl API from their merchant gateway to calculate
sales tax. Since the client was in a shared hosting environment they
couldn't do it, the only solution provided by netsol was to upgrade to
a virtual server environment. I ended up just writing the code in
their Perl order processor to replicate the API's function.
Bill H
>
> --
> Gunnar Hjalmarsson
> Email:http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Thu, 29 May 2008 20:22:27 -0400
From: "Dick Sutton" <rsutton43@comcast.net>
Subject: Re: Need help with a simple (I think) Perl script
Message-Id: <ZO-dnUexfOD01aLVnZ2dnUVZ_s3inZ2d@comcast.com>
"Gordon Etly" <na@clpm.dilavni> wrote in message
news:6a8ncqF348ldrU1@mid.individual.net...
> A. Sinan Unur wrote:
>> Ted Zlatanov <tzz@lifelogs.com> wrote in
>> > On 29 May 2008 12:08:32 -0500 Lawrence Statton wrote:
>
> ...
>
>> > Did it perhaps occur to you that not everyone knows Perl variable
>> > names are case-sensitive, and that not every programming language is
>> > like Perl?
>
>> > You and A. Sinan Unur are being nasty when a quick look at the
>> > original script would have been sufficient to understand the
>> > miscommunication.
>
>> No.
>>
>> In the original script, there is a
>>
>> use strict;
>>
>> line. Had that line actually been in the script rather than pasted
>> into the post as an after-thought, the typo would have been caught by
>> the OP.
>>
>> Hence, my belief that the poster intentionally misrepresented the
>> contents of the script. That is, he lied.
>
> How typical. Just assume he lied. I suppose it also didn't occur to you
> that maybe he mistakenly capitalized the those variables in that one line
> by mistake? Or maybe something happened when spellchecking. It easily
> could have been just a harmless mistake, yet you act like he just lied in
> court and you're the judge.
>
>
> --
> G.Etly
>
Gordon Etly,
I am sure that people like Mr. Unur are a relatively small group. However,
I would like to point out that I had never 'run' the script because I didn't
know how to finish it. As I also pointed out, I am a new to Perl scripts.
Yes, I did mistype the lines in question. You may even find further syntax
errors in the piece of code that I presented. After all, I said I was
stuck, I hadn't finished it. I didn't paste in a line 'use strict;' just to
harass the newsgroup. I read that Perl programs should use that line, so I
placed it in there.
I really take offense at being called a liar and being incompetent. I am
trying to learn Perl on my own and I expect to make mistakes. But I don't
expect to be insulted.
Again, I thank those that made an honest attempt to help me, but I believe I
may be better served at this point to go to the library and check out a few
Perl books and continue learning on my own.
Dick
------------------------------
Date: Fri, 30 May 2008 02:45:47 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Need help with a simple (I think) Perl script
Message-Id: <6a914nF36bukjU1@mid.individual.net>
szr wrote:
> Gunnar Hjalmarsson wrote:
>> Bill H wrote:
>>> The other suggestion of installing this or using that module, not
>>> everyone who is programming in perl for cgi has their own server or
>>> has the ability of adding new modules to the server (fortunatly I do)
>>> and have to work within the capabilities of the system they are
>>> running on. So if they post a problem and there is a solution that
>>> wouldn't require them installing a module, recommend it, instead of
>>> just saying use blah::blah.
>>
>> Sometimes when people say "can't" install this or that module, they
>> actually mean "don't know how to". For instance, I have never heard
>> of a situation when a pure Perl module can't be installed, in one way
>> or another. So encouraging people to learn how to make use of modules
>> is usually the right thing to do.
>
> There are some modules, even pure Perl ones, that might have a
> dependency on something that isn't installed, and the user is not able
> to install said dependency.
Well, I for one wouldn't say "pure Perl module" about a module that's
dependent on a non-core XS module.
> Or one doesn't have shell access or the
> hosting account uses a Windows server (and most don't give you any sort
> of shell or remote desktop access.)
You don't need shell access to install a pure Perl module. Sure, you
can't install it "the right way", but uploading a .pm file to a suitable
folder with e.g. FTP and adding a "use lib" statement is always possible.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.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 V11 Issue 1589
***************************************