[16543] in Perl-Users-Digest
Perl-Users Digest, Issue: 3955 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Aug 8 21:05:28 2000
Date: Tue, 8 Aug 2000 18:05:16 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <965783115-v9-i3955@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Tue, 8 Aug 2000 Volume: 9 Number: 3955
Today's topics:
Re: A fork and Socket problem! <tim@ipac.caltech.edu>
activestate vs indigoperl (konstantine a. dallas)
Re: CGI : CheckBox and Form Question <daniel@blackomega.com>
Re: CGI.PM How to get all Form's value in a HashTable? <daniel@blackomega.com>
Re: Chess Game (Deep Blue) in Perl? (Abigail)
Re: Converting from US dates/numbers to European dates/ <godzilla@stomp.stomp.tokyo>
Re: Converting from US dates/numbers to European dates/ <godzilla@stomp.stomp.tokyo>
Re: Converting from US dates/numbers to European dates/ <godzilla@stomp.stomp.tokyo>
Re: Converting from US dates/numbers to European dates/ <juex@deja.com>
Re: Converting from US dates/numbers to European dates/ <waltman@netaxs.com>
Re: Cross-platform shebang line CGI script shenanigans (David Efflandt)
Re: DBI: LAST_INSERT_ID() getting the value of <linux@worsdall.demon.co.uk>
Re: DBI: LAST_INSERT_ID() getting the value of <linux@worsdall.demon.co.uk>
Re: Difference between a .cgi file and a .pl file? <jthomas@pdxgothic.com>
Error on PERL 5.6 install <president@webticker.com>
Re: Expert advise needed (Abigail)
Re: get temporary file name? <tim@ipac.caltech.edu>
Re: Help with a script <tim@ipac.caltech.edu>
Re: How to capture CGI program .exe output, modify it a <bart.lateur@skynet.be>
Re: Howto find module informations in perldoc (Marcel Grunauer)
Re: Howto find module informations in perldoc <ren.maddox@tivoli.com>
Ibogaine: A Cure For Butt Fungus? <no.user@anon.xg.nu>
Re: is mysql faster using Perl or PHP? hamed53@my-deja.com
Re: is mysql faster using Perl or PHP? hamed53@my-deja.com
Re: Mail::Send Problem! (Clinton A. Pierce)
Re: Mail::Send Problem! kaivix@angelfire.com
Re: Newbie questions: What exactly is $_? fathacka@my-deja.com
Re: Newbie questions: What exactly is $_? <lr@hpl.hp.com>
Re: Newbie questions: What exactly is $_? (Tim)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 08 Aug 2000 16:46:02 -0700
From: Tim Conrow <tim@ipac.caltech.edu>
Subject: Re: A fork and Socket problem!
Message-Id: <39909BBA.392C9FC3@ipac.caltech.edu>
Tim Cockle wrote:
> Basically my proxy sits between the browser and the real-proxy (that
> servers my department) parsing HTML.
>
> I open a server socket and use the normal while loop to deal with
> clients:
> while ($browser = $server->accept()) {
>
> If I then fork (the line I use is next if $pid = fork;) and allow to
> child to open a new socket to the real-proxy I get an error when I try
> to write.
> If though I the parent to open the connection to the proxy BEFORE I fork
> every thing works fine!
>
> Can some one tell me why please?!?!?!?!
> And if/how I can get the child to open the socket to the real proxy?
Please send stripped down code that shows the problem, along with sample inputs
and outputs. We can't help you with what we can't see.
--
-- Tim Conrow tim@ipac.caltech.edu 626-395-8435
------------------------------
Date: 8 Aug 2000 22:46:12 GMT
From: kdallas@uswestmail.net (konstantine a. dallas)
Subject: activestate vs indigoperl
Message-Id: <8mq2jk$vhv$1@nntp9.atl.mindspring.net>
Anyone have any feels or opinions on activestate vs indigoperl? I have tried
both and indigoperl both seem to work fine.
Konstantine
------------------------------
Date: Wed, 9 Aug 2000 00:11:07 +0100
From: "Daniel Foster" <daniel@blackomega.com>
Subject: Re: CGI : CheckBox and Form Question
Message-Id: <8mq46q$luo$2@newsg4.svr.pol.co.uk>
How about:
if (defined($co->param('checkbox1'))
{
# do your database stuff here
}
Works fine for me in a similar application.
---
Someone needs to invent a thought laxative.
- Sean Hopkins
Daniel Foster - daniel@blackomega.com
------------------------------
Date: Wed, 9 Aug 2000 00:07:51 +0100
From: "Daniel Foster" <daniel@blackomega.com>
Subject: Re: CGI.PM How to get all Form's value in a HashTable?
Message-Id: <8mq46p$luo$1@newsg4.svr.pol.co.uk>
> sub parse_data{
>
> # Return a HashTable name=>value
>
> my $query = new CGI;
> local $request_method = $ENV{'REQUEST_METHOD'};
> if ( $request_method eq "GET") {
> return map { $_ => param($_) } param();
> }
> else{
> return $query->Vars;
> }
> }
Any reason for the if-else construct - is there some circumstance
under which the neat map won't work?
---
There may be a correlation between humour and sex. More
research is clearly needed.
- Data
Daniel Foster - daniel@blackomega.com
------------------------------
Date: 08 Aug 2000 22:48:55 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Chess Game (Deep Blue) in Perl?
Message-Id: <slrn8p13i2.st1.abigail@alexandra.foad.org>
Kermit (as@if.com) wrote on MMDXXXIV September MCMXCIII in
<URL:news:wCVj5.116535$1h3.1839941@news20.bellglobal.com>:
::
:: Thank you for the feedback, would you have any suggestions as how I would go
:: at it? For example, should I use the chess module or how do I setup the
:: table?
What chess module? There's no chess module coming with Perl.
As for setting up tables, well, making a chess program is largely indepent
of the language used. Perhaps 5% is language dependent, probably less.
If you have to ask such questions, perhaps you should reconsider.
Abigail
--
# Perl 5.6.0 broke this.
%0=map{reverse+chop,$_}ABC,ACB,BAC,BCA,CAB,CBA;$_=shift().AC;1while+s/(\d+)((.)
(.))/($0=$1-1)?"$0$3$0{$2}1$2$0$0{$2}$4":"$3 => $4\n"/xeg;print#Towers of Hanoi
------------------------------
Date: Tue, 08 Aug 2000 15:30:17 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Converting from US dates/numbers to European dates/numbers
Message-Id: <399089F9.19413644@stomp.stomp.tokyo>
Walt Mankowski wrote:
> programmer in the US to write
> $pi = 3.14159
> and a programmer in France to write
> $pi = 3,14159
> Both numbers will be stored internally exactly the same way.
> Please read perldoc perllocale for more information.
What does this have to do with the original question
of this thread? Well?
Jeesshh... you boys are mondo beyondo.
Godzilla!
------------------------------
Date: Tue, 08 Aug 2000 15:33:43 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Converting from US dates/numbers to European dates/numbers
Message-Id: <39908AC7.89A7BAB7@stomp.stomp.tokyo>
"Jürgen Exner" wrote:
> Godzilla!
> Although it might not be totally impossible still I
> highly doubt that there is any CPU or math co-processor
> that has any notion of what you call a decimal point.
> You may want to brush up on how numerical computation is
> done in a computer.
What does this have to do with the original question
of this thread? Well?
Jeesshh... you boys are mondo beyondo.
Godzilla!
------------------------------
Date: Tue, 08 Aug 2000 15:46:24 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Converting from US dates/numbers to European dates/numbers
Message-Id: <39908DC0.2A1A19CE@stomp.stomp.tokyo>
Drew Simonis spewed:
> Godzilla! wrote:
(snipped with delight)
You know, like you boys are so ignorant when
it comes to language and communication, you
have yet, between the whole barnyard lot of
you mules, to realize you are sitting there
telling me I don't need to use a decimal
point when I do calculations on my computer
or my electronic calculator.
Boy-oh-boy, get your heads and beady eyes
out of Xah's Perl Perl Land and get real!
I've enjoyed eleven and twelve year old
students in class with more smarts and
more in touch with reality than all of you
boys together.
You come across with this attitude people
are Linux operating systems, have keyboards
for eyeballs and a Perl 'Hello World!' script
for brains. Christ, turn off your computers,
go outside and play for the next ten years.
There are decimal points out there just waiting
to be touched and loved.
This ain't Tron.
Jeeeshhh... talk about computer addiction!
Techno-Geekster Junkies who haven't seen
the light of day in years!
* flashes her lack of tanlines *
Know what I mean?
Godzilla!
------------------------------
Date: Tue, 8 Aug 2000 16:12:21 -0700
From: "Jürgen Exner" <juex@deja.com>
Subject: Re: Converting from US dates/numbers to European dates/numbers
Message-Id: <399093bc$1@news.microsoft.com>
"Godzilla!" <godzilla@stomp.stomp.tokyo> wrote in message
news:39908AC7.89A7BAB7@stomp.stomp.tokyo...
> "Jürgen Exner" wrote:
>
> > Godzilla!
>
> > Although it might not be totally impossible still I
> > highly doubt that there is any CPU or math co-processor
> > that has any notion of what you call a decimal point.
> > You may want to brush up on how numerical computation is
> > done in a computer.
>
> What does this have to do with the original question
> of this thread? Well?
>
> Jeesshh... you boys are mondo beyondo.
Do you really need to be reminded about what you (yes, you!) wrote just a
few hours earlier?
<begin citation>
So, you are stating a computer CPU / math co-processor recognizes
a comma as a decimal point [...]
<end citation>
So, maybe you could answer the simple question who brought the subject of
how CPUs and copros handle decimal separators into this discussion.
As for me: I've enough of your evading questions, changing subjects at will,
and insincere attitude:
*PLONK*
jue
------------------------------
Date: 08 Aug 2000 19:31:14 -0400
From: Walt Mankowski <waltman@netaxs.com>
Subject: Re: Converting from US dates/numbers to European dates/numbers
Message-Id: <m3aeens531.fsf@netaxs.com>
"Godzilla!" <godzilla@stomp.stomp.tokyo> writes:
> What does this have to do with the original question
> of this thread? Well?
The original question was how to get a Perl program to recognize a
comma as a decimal point. That's what locales are for. Have you
bothered to read perllocale yet?
------------------------------
Date: Wed, 9 Aug 2000 00:58:46 +0000 (UTC)
From: efflandt@xnet.com (David Efflandt)
Subject: Re: Cross-platform shebang line CGI script shenanigans - Windows and Linux with Apache
Message-Id: <slrn8p1b63.3ek.efflandt@efflandt.xnet.com>
On Tue, 8 Aug 2000, Glyndwr <glynFOOdwr@FSCKdeleteEmeD.co.uk> wrote:
>I've been involved recently in efforts to move some websites from
>Debian/Apahce/Perl/MySQL to a Windows2000 laptop for demoing purposes.
>Everything works fine, but in order to make each CGI script work, the
>shebang line needs to be changed from
>
>#!/usr/bin/perl [Linux]
>to
>#!c:/perl/bin/perl.exe [Windows]
>
>Does anyone know of any way to write a single shebang line that works on
>both platforms? I'm thinking something with eval should work, but my poor
>brain isn't up to the task.. Thanks in advance.
The optimum solution would be to set up the laptop to dual boot Linux, but
if that is not an option, write a perl script to change it for you.
The regex you want to run on the first line of each text (-T) file is
s/^(#!\s*)([^p]*perl[\S]*)/$1$newpath/i
--
David Efflandt efflandt@xnet.com http://www.de-srv.com/
http://www.autox.chicago.il.us/ http://www.berniesfloral.net/
http://hammer.prohosting.com/~cgi-wiz/ http://cgi-help.virtualave.net/
------------------------------
Date: Wed, 9 Aug 2000 01:36:07 +0100
From: Mark Worsdall <linux@worsdall.demon.co.uk>
Subject: Re: DBI: LAST_INSERT_ID() getting the value of
Message-Id: <XHR5WUA3dKk5Ew+s@worsdall.demon.co.uk>
In article <slrn8p0pou.t0t.jsd@cluttered.com>, Jon Drukman
<jsd@cluttered.com> writes
>On Mon, 7 Aug 2000 23:15:27 +0100, Mark Worsdall
> <linux@worsdall.demon.co.uk> wrote:
>>How can I return into my own variable the last auto inc id after an
>>insert?
>>
>>This doesn't work:-(
>
>this is mostly a database question, not a perl question.
>
>>$sth = $dbh->prepare("SELECT LAST_INSERT_ID() FROM SearchPhrases");
>>$sth->execute();
>>$sth->finish();
>>$phrases_id = $sth->fetchrow_array();
>>print "ID: $phrases_id\n";
>
>two problems:
>
>1. last_insert_id() doesn't use a "from" clause.
>2. you're doing too much work. :)
>
>these two lines will replace the 5 you have above...
>
> @row_ary=$dbh->selectrow_array('SELECT LAST_INSERT_ID()');
> print "created new row with id $row_ary[0]\n";
>
>oh, and you have one other choice. for sufficiently modern versions of
>mySQL/DBI/DBD::mysql, you can do this:
>
> my $sth=$dbh->prepare('INSERT INTO test (label) VALUES (?)');
> $sth->execute('new label');
> print "created new row with id $sth->{'insertid'} \n";
>
>the key here is that the statement handle automatically has the
>insertid element created.
>
Oh Xclent, thanks:-)
--
He came from Econet - Oh no, I've run out of underpants :(
Home:- jaydee@wizdom.org.uk http://www.wizdom.org.uk
Shadow:- webmaster@shadow.org.uk http://www.shadow.org.uk
Work:- netman@hinwick.demon.co.uk http://www.hinwick.demon.co.uk
Web site Monitoring:- http://www.shadow.org.uk/SiteSight/
------------------------------
Date: Wed, 9 Aug 2000 01:41:51 +0100
From: Mark Worsdall <linux@worsdall.demon.co.uk>
Subject: Re: DBI: LAST_INSERT_ID() getting the value of
Message-Id: <kHv12jAPjKk5Ew5X@worsdall.demon.co.uk>
In article <slrn8p0pou.t0t.jsd@cluttered.com>, Jon Drukman
<jsd@cluttered.com> writes
>On Mon, 7 Aug 2000 23:15:27 +0100, Mark Worsdall
> <linux@worsdall.demon.co.uk> wrote:
>>How can I return into my own variable the last auto inc id after an
>>insert?
>>
>>This doesn't work:-(
>
>this is mostly a database question, not a perl question.
>
>>$sth = $dbh->prepare("SELECT LAST_INSERT_ID() FROM SearchPhrases");
>>$sth->execute();
>>$sth->finish();
>>$phrases_id = $sth->fetchrow_array();
>>print "ID: $phrases_id\n";
>
>two problems:
>
>1. last_insert_id() doesn't use a "from" clause.
>2. you're doing too much work. :)
>
>these two lines will replace the 5 you have above...
>
> @row_ary=$dbh->selectrow_array('SELECT LAST_INSERT_ID()');
> print "created new row with id $row_ary[0]\n";
>
>oh, and you have one other choice. for sufficiently modern versions of
>mySQL/DBI/DBD::mysql, you can do this:
>
> my $sth=$dbh->prepare('INSERT INTO test (label) VALUES (?)');
> $sth->execute('new label');
> print "created new row with id $sth->{'insertid'} \n";
>
>the key here is that the statement handle automatically has the
>insertid element created.
>
So could I form a command that:
INSERT ONLY if a STRING doesn't exist in stringColumn
and so then I would only do an update if $sth->{'insertid'} != 0
print "created/updated row with id $sth->{'insertid'} \n";
How would that look?
--
He came from Econet - Oh no, I've run out of underpants :(
Home:- jaydee@wizdom.org.uk http://www.wizdom.org.uk
Shadow:- webmaster@shadow.org.uk http://www.shadow.org.uk
Work:- netman@hinwick.demon.co.uk http://www.hinwick.demon.co.uk
Web site Monitoring:- http://www.shadow.org.uk/SiteSight/
------------------------------
Date: Tue, 8 Aug 2000 15:54:52 -0700
From: "Jack Thomas" <jthomas@pdxgothic.com>
Subject: Re: Difference between a .cgi file and a .pl file?
Message-Id: <3990902e$1_1@news.nwlink.com>
I think your all missing the point of my reply to the person who asked the
question originally.
The original message was as follows:
"DS" <snakeman@kc.rr.com> wrote in message
news:vjmc5.94$L5.2310@typhoon.kc.rr.com...
> What is the diference betweeen a .pl file and a .cgi file?
> Can I convert a .pl to a .cgi?
And I responded with:
>Perl .pl and Perl .cgi are file types which are equivalent.
>If you want to convert a .pl file to a .cgi file, you simply need to rename
it.
My answer was SPECIFIC to Perl .pl and Perl .cgi files.
A .cgi could file could very well be a .exe file on an NT server, or it
could be written in Python, or Java, or whatever...
You must of course keep in mind, that it really depends on the MIME type
mapping on the server as well.
Jack Thomas
jthomas@pdxgothic.com
"brian d foy" <brian@smithrenaud.com> wrote in message
news:brian-ya02408000R0708000953040001@news.panix.com...
> In article <398e789f$1_2@news.nwlink.com>, "Jack Thomas"
<jthomas@pdxgothic.com> posted:
>
> > Perl .pl and Perl .cgi are file types which are equivalent.
>
> maybe. it depends on what importance a certain application places
> on file extensions.
>
> --
> brian d foy
> CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
> Perl Mongers <URL:http://www.perl.org/>
------------------------------
Date: Wed, 09 Aug 2000 00:23:24 GMT
From: Julian Cook/Sherab Gyatso <president@webticker.com>
Subject: Error on PERL 5.6 install
Message-Id: <3990A42E.5537B1BF@webticker.com>
Hi folks!
I am trying to install PERL 5.6 on a Pentium 75 running Slackware 7
kernal 2.2.13. My current Perl is 5.005_03 for i386-linux (it came with
the linux distro)
I downloaded the PERL 5.6 distribution and first issued a
"rm -f config.sh Policy.sh "
(no problem)
"sh Configure -de"
(no problem)
"make"
OK,.here I run into problems....
Specifically when the system gets to...
`sh cflags libperl.a toke.o` toke.c
CCCMD = cc -DPERL-CORE -c -fno-strict-aliasing
-I/usr/local/include -0
I get this error.....
cc: Internal compiler error: program cc1 got fatal signal 7
make ***{toke.o} Error 1
I know this is very vague, but can anyone point me in the next possible
direction to in tracking this error?
Many thanks in advance for all of your help..
Julian
president_at_webticker_dot_com
------------------------------
Date: 09 Aug 2000 00:21:26 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Expert advise needed
Message-Id: <slrn8p18vc.cro.abigail@alexandra.foad.org>
Logan Shaw (logan@cs.utexas.edu) wrote on MMDXXXIV September MCMXCIII in
<URL:news:8mpr9e$a4j$1@provolone.cs.utexas.edu>:
[] In article <slrn8p06h1.st1.abigail@alexandra.foad.org>,
[] Abigail <abigail@foad.org> wrote:
[] >Ask your boss whether he's a criminal himself, who illegally copies
[] >books, CDs and dollar bills. If he isn't, ask him why he assumes your
[] >customers are.
[]
[] All it takes is for one customer to illegally copy the source code for
[] there to be a problem.
Same for books, CDs, movies, etc.
Abigail
--
package Z;use overload'""'=>sub{$b++?Hacker:Another};
sub TIESCALAR{bless\my$y=>Z}sub FETCH{$a++?Perl:Just}
$,=$";my$x=tie+my$y=>Z;print$y,$x,$y,$x,"\n";#Abigail
------------------------------
Date: Tue, 08 Aug 2000 16:35:17 -0700
From: Tim Conrow <tim@ipac.caltech.edu>
Subject: Re: get temporary file name?
Message-Id: <39909935.A2D927A@ipac.caltech.edu>
% perldoc -q temporary
=head1 Found in /usr/local/lib/perl5/5.6.0/pod/perlfaq5.pod
=head2 How do I make a temporary file name?
Like magic, isn't it? Documentation is a wonderful thing.
--
-- Tim Conrow tim@ipac.caltech.edu 626-395-8435
------------------------------
Date: Tue, 08 Aug 2000 16:42:56 -0700
From: Tim Conrow <tim@ipac.caltech.edu>
Subject: Re: Help with a script
Message-Id: <39909B00.9B39FF25@ipac.caltech.edu>
>I'm trying to write a perl script as a metric for java- to count the
>lines, classes, etc. The program is having trouble even taking in the
>java file. If anyone could take a look at this and see where I'm going
>wrong, that would be great!
Please help yourself by helping us; reduce your problem to one that is
manageable. Please:
- tell us exactly what the program is supposed to do, including inputs and
outputs
- tell us what it did do, emphasizing what you think went wrong
- tell us what you've done to debug it so far
- try to simplify the code till it's something folks with jobs and lives will
have time to look at
Often by the time you've gone through this process, you'll find the problem
yourself.
--
-- Tim Conrow tim@ipac.caltech.edu 626-395-8435
------------------------------
Date: Tue, 08 Aug 2000 23:34:24 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: How to capture CGI program .exe output, modify it and then pass back to browser (client)
Message-Id: <sg51ps4otpf033nruc778h42rojhmodhm2@4ax.com>
barrybx@my-deja.com wrote:
>I have a CGI program with no source code, i.e. cgiprogram.exe.
>
>The arguments pass to the cgi program must use post method,
>I need to run the cgi program, get value from the output and redirect the
>output (data) to another url (html page).
I assume you DON'T want this raw program to be directly on Internet?
Maybe you could run this on a (your?) web server, through localhost, via
the LWP module. Make sure people can't reach it from the outside. Hmmm..
a firewall, and talking to your web server on a different than the
default port, one that is blocked from the outside? Lots of work.
Let's try the raw mode. Unless I'm mistaking, POST means that you must
pipe the data into the program, for example from a file, after having
set $ENV{REQUEST_METHOD} to "POST", and $ENV{CONTENT_LENGTH} to the
length of the data string. Then, you're ready to run the program and
capture the output. Finally, strip the header and parse the data.
open OUT, ">$ENV{TEMP}/tempfile"; # or die...
binmode OUT;
print OUT $data;
close OUT;
$ENV{REQUEST_METHOD} = 'POST';
$ENV{CONTENT_LENGTH} = length $data;
$output = `cgiprogram.exe <$ENV{TEMP}/tempfile`;
$output =~ tr/\r//d;
$output =~ s/^(?:.+\n)+\n//;
Er, something like that...
--
Bart.
------------------------------
Date: Tue, 08 Aug 2000 23:15:04 GMT
From: marcel@codewerk.com (Marcel Grunauer)
Subject: Re: Howto find module informations in perldoc
Message-Id: <slrn8p1526.h1e.marcel@gandalf.local>
On Tue, 8 Aug 2000 22:38:14 +0200, Otto Wyss <otto.wyss@bluewin.ch> wrote:
>I'd like to know anything about the "Getoptions" in the following script
>but I don't know howto use perldoc, i.e.
>
>perldoc Getopt
>No documentation found for "Getopt"
>use Getopt::Long;
Try the obvious thing:
perldoc Getopt::Long
perldoc will search for a module name (in this case, Getopt/Long.pm)
in any of the @INC directories. This also works for pragmata, which are
also (more or less, for this purpose anyway) modules:
perldoc strict
--
Marcel
sub AUTOLOAD{($_=$AUTOLOAD)=~s;^.*::;;;y;_; ;;print} Just_Another_Perl_Hacker();
------------------------------
Date: 08 Aug 2000 16:25:38 -0500
From: Ren Maddox <ren.maddox@tivoli.com>
Subject: Re: Howto find module informations in perldoc
Message-Id: <m3wvhrbg31.fsf@dhcp11-177.support.tivoli.com>
otto.wyss@bluewin.ch (Otto Wyss) writes:
> perldoc Getopt
> No documentation found for "Getopt"
perldoc Getopt::Long
--
Ren Maddox
ren@tivoli.com
------------------------------
Date: Tue, 8 Aug 2000 16:44:53 -0500
From: No User <no.user@anon.xg.nu>
Subject: Ibogaine: A Cure For Butt Fungus?
Message-Id: <b9fdc2a02b1a4365fbf64d53361f5aa3@anon.xg.nu>
It worked for me. I went to Canada and got new Nestles Ibogaine Quik. It
tasted kind of strange, but it worked.
It knocked me on my ass for five days and the fungus was gone when I recovered!
It seems to me it would work for everyone...anyone know how much red tape is involved in getting a research permit from the DEA for this?
---
This message did not originate from the Sender address above.
It was posted with the use of anonymizing software at
http://anon.xg.nu
---
------------------------------
Date: Tue, 08 Aug 2000 23:14:47 GMT
From: hamed53@my-deja.com
Subject: Re: is mysql faster using Perl or PHP?
Message-Id: <8mq495$lj8$1@nnrp1.deja.com>
Rafael,
Not fastest to write the code, what i ment by fastesy was in terms of
database connectivity...
In article <slrn8osns1.fgf.rgarciasuarez@rafael.kazibao.net>,
rgarciasuarez@free.fr (Rafael Garcia-Suarez) wrote:
> hamed53@my-deja.com wrote in comp.lang.perl.misc:
> >Hi,
> >
> >can those people with expeirnce using MySQL on Perl and PHP tell me
> >which langauge is faster to write a mysql database connection with?
>
> "faster to write" depends on how fluent you are in these languages.
> There is not much code to write in both languages.
> Perl is more portable though (because it uses an unified database
> interface, known as the DBI), and seems to handle more correctly
> tricky stuff such as embedding user-provided values in SQL statements,
> or error handling. But I'm biased towards perl.
>
> --
> Rafael Garcia-Suarez
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 08 Aug 2000 23:21:14 GMT
From: hamed53@my-deja.com
Subject: Re: is mysql faster using Perl or PHP?
Message-Id: <8mq4l8$lu4$1@nnrp1.deja.com>
brian,
> > The Perl DBI allows interaction with SQL databases but
> > is more taxing on resources than PHP.
>
> perhaps you can elaborate. you don't seem to know anything about
> PHP, Perl, or MySQL, so it's dubious that you could the grounds
> for such a claim.
From reading your comments on Kris's comment, it seems you claim that
you may have a wider knowledge on Perl, PHP or MySQL...
Now, what is your reply to "my" (original) message? What is your idea?
is database connectivity with MySQL is faster in Perl or PHP?
For example, if i wanted to write a database driven forum or search
engine or any program that depends or relays on MySQL (or gets the mass
data from), would you suggest me to write it in Perl or PHP?
Thanks...
Hamed
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 09 Aug 2000 00:16:51 GMT
From: clintp@geeksalad.org (Clinton A. Pierce)
Subject: Re: Mail::Send Problem!
Message-Id: <Tp1k5.61295$fR2.641626@news1.rdc1.mi.home.com>
[Posted and mailed]
In article <25_j5.563$juZ4.9568592@tomcat.sk.sympatico.ca>,
kaivix@angelfire.com writes:
> How can I place carriage returns in the body of an e-mail message when using
> Mail::Send???
> [...]
> ##HERE IS THE PROBLEM:
> print $fh qw|
> Line1 of e-mail
> Line2
> Line3
> ...
>|;
>
> $fh->close;
You bet that's the problem.
First, do you know what qw does? It constructs a list. It's probably
inappropriate to put LINES of text in a qw() operator.
Secondly, if this is really what you intended...there are no carriage
returns in there qw() just wants whitespace delimited stuff, and the
newlines in the text is just whitespace.
You probably meant something more like:
print $fh<<EOF;
Line 1
Line 2
Line3
EOF
A whole different construct altogether.
--
Clinton A. Pierce Teach Yourself Perl in 24 Hours!
clintp@geeksalad.org for details see http://www.geeksalad.org
"If you rush a Miracle Man,
you get rotten Miracles." --Miracle Max, The Princess Bride
------------------------------
Date: Wed, 09 Aug 2000 00:35:17 GMT
From: kaivix@angelfire.com
Subject: Re: Mail::Send Problem!
Message-Id: <9H1k5.579$juZ4.3670054@tomcat.sk.sympatico.ca>
I found out the problem just before Clinton gave me an answer!
I had qw(), which he pointed out, and I had looked over my code a few
times before having noticed it.
What I had meant to use was qq(), which I have now replaced and
everything works great now!
>
> Re: Mail::Send Problem!
>
> From: clintp@geeksalad.org (Clinton A. Pierce)
> Reply to: [1]Clinton A. Pierce
> Date: Wed, 09 Aug 2000 00:16:51 GMT
> Organization: @Home Network
> Newsgroups:
> [2]comp.lang.perl.misc
> Followup to: [3]newsgroup(s)
> References:
> [4]<25_j5.563$juZ4.9568592@tomcat.sk.sympatico.ca>
>
>[Posted and mailed]
>
>In article [5]<25_j5.563$juZ4.9568592@tomcat.sk.sympatico.ca>,
> kaivix@angelfire.com writes:
>> How can I place carriage returns in the body of an e-mail message when using
>> Mail::Send???
>> [...]
>> ##HERE IS THE PROBLEM:
>> print $fh qw|
>> Line1 of e-mail
>> Line2
>> Line3
>> ...
>>|;
>>
>> $fh->close;
>
>You bet that's the problem.
>
>First, do you know what qw does? It constructs a list. It's probably
>inappropriate to put LINES of text in a qw() operator.
>
>Secondly, if this is really what you intended...there are no carriage
>returns in there qw() just wants whitespace delimited stuff, and the
>newlines in the text is just whitespace.
>
>You probably meant something more like:
>
>print $fh<<EOF;
>Line 1
>Line 2
>Line3
>EOF
>
>A whole different construct altogether.
>
>--
> Clinton A. Pierce Teach Yourself Perl in 24 Hours!
> clintp@geeksalad.org for details see [6]http://www.geeksalad.org
>"If you rush a Miracle Man,
> you get rotten Miracles." --Miracle Max, The Princess Bride
------------------------------
Date: Tue, 08 Aug 2000 22:32:12 GMT
From: fathacka@my-deja.com
Subject: Re: Newbie questions: What exactly is $_?
Message-Id: <8mq1pc$k3b$1@nnrp1.deja.com>
Hi,
I did, but I still don't understand what it meant. It says:
"The default input and pattern-searching space."
It goes on to give a few examples. It also says where it is used.
However, it still doesn't answer some questions I have. Does it have a
default value upon entering a subroutine, like @_ does or is it undef?
Is $_ at all affiliated with @_, or does it have some fundamental
difference?
Thanks
In article <3990633F.C4920E1B@attglobal.net>,
Drew Simonis <care227@attglobal.net> wrote:
> fathacka@my-deja.com wrote:
> >
> > I tried searching the documentation on www.perl.com, but nothing
seemed
> > to explicitly state what exactly $_ is. I also tried searching for
it
> > in the O'Reilly book "Learning Perl", and they use it and state that
it
> > is a "default value", but never explain to full detail what it is.
>
> Did you read perlvar?
>
> http://www.perl.com/pub/doc/manual/html/pod/perlvar.html
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 8 Aug 2000 16:11:29 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Newbie questions: What exactly is $_?
Message-Id: <MPG.13fa337a7f8771eb98ac4e@nntp.hpl.hp.com>
In article <8mq1pc$k3b$1@nnrp1.deja.com> on Tue, 08 Aug 2000 22:32:12
GMT, fathacka@my-deja.com <fathacka@my-deja.com> says...
> I did, but I still don't understand what it meant. It says:
> "The default input and pattern-searching space."
>
> It goes on to give a few examples. It also says where it is used.
> However, it still doesn't answer some questions I have. Does it have a
> default value upon entering a subroutine, like @_ does or is it undef?
It is a global variable, whose value is unchanged on entry to a
subroutine. If the subroutine changes it and returns, $_ retains the
changed value. Unless this is desired, any subroutine that changes $_
should use a localized copy (`perldoc -f local`).
sub foo {
local $_ = $_; # Make a localized copy.
s/bar/baz/;
print; # "baz\n"
}
$_ = "bar\n";
foo();
print; # "bar\n";
> Is $_ at all affiliated with @_, or does it have some fundamental
> difference?
No relationship whatever.
> Thanks
You're welcome. In the future, you'll be more welcome if you
intersperse your remarks within or after the post you are responding to,
instead of blindly quoting it at the end of your response.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Tue, 08 Aug 2000 23:22:59 GMT
From: SPAM+indigo@dimensional.com (Tim)
Subject: Re: Newbie questions: What exactly is $_?
Message-Id: <8F8AB31E3indigodimcom@166.93.207.145>
fathacka@my-deja.com wrote in <8mq1pc$k3b$1@nnrp1.deja.com>:
>Hi,
>
>I did, but I still don't understand what it meant. It says:
>"The default input and pattern-searching space."
>
>It goes on to give a few examples. It also says where it is used.
>However, it still doesn't answer some questions I have. Does it have a
>default value upon entering a subroutine, like @_ does or is it undef?
>Is $_ at all affiliated with @_, or does it have some fundamental
>difference?
Some commands put stuff into $_, and others take stuff out. You
should only use $_ if you understand both.
Here is an example:
# Warning - untested code fragments
# Without $_
for my $element (@array)
{
$element =~ s/abc/xyz/g;
print "$element\n";
}
# With $_
for (@array)
{
s/abc/xyz/g;
print "$_\n";
}
Also, for the most part, $_ and @_ are not related.
In addition to perlvar, you may wish to peruse some of
the other perl man pages for specific case when $_ is
used. The angle operators (<>) might be a good place
to start.
-T
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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 V9 Issue 3955
**************************************