[16004] in Perl-Users-Digest
Perl-Users Digest, Issue: 3416 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jun 19 00:11:26 2000
Date: Sun, 18 Jun 2000 21:10:13 -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: <961387813-v9-i3416@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Sun, 18 Jun 2000 Volume: 9 Number: 3416
Today's topics:
Net::Ping, or similar <garstangd@news.com.au>
Re: OT: Re: A Computer Programmers Profile <mdemello@pound.ruf.rice.edu>
Re: perl CGI on an Linux based apache webserver (Decklin Foster)
Perl Performance using Objects (Philip Taylor)
Re: Perl Performance using Objects (Eric Bohlman)
Re: Reintegrating win into CPAN (Was Re: What is the CP <abe@ztreet.demon.nl>
Re: Reintegrating win into CPAN (Was Re: What is the CP <elaine@chaos.wustl.edu>
Re: simple array question <ils@gil.com.au>
Re: simple array question <ils@gil.com.au>
What the... <altavistaNOalSPAM@agentkhaki.com.invalid>
Re: What the... <nnickee@nnickee.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 19 Jun 2000 02:09:39 GMT
From: "Dougas Garstang" <garstangd@news.com.au>
Subject: Net::Ping, or similar
Message-Id: <Dhf35.1510$y63.402925@news0.optus.net.au>
All,
Has anyone ever seen a ping module that can return the time taken for a ping
response? The standard Net::Ping module doesn't seem to support this... only
a "yes it was alive" or "no it wasn't" response.
I could pipe the output from the ping command under linux/solaris but of
course those versions of ping NEVER time out. To make matters worse, I am
also using IO::Socket at the same time. I have NEVER been able to get calls
to alarm() to work when using IO::Socket.
Grrr!
Regards
Douglas.
------------------------------
Date: 18 Jun 2000 18:24:06 GMT
From: Martin Julian DeMello <mdemello@pound.ruf.rice.edu>
Subject: Re: OT: Re: A Computer Programmers Profile
Message-Id: <8ij446$qe2$3@joe.rice.edu>
Larry Rosler <lr@hpl.hp.com> wrote:
> -0500, Russ Jones <russ_jones@rac.ray.com> says...
>>
>> Poor grammar is one thing up with which we must not put.
>>
>> - Winston Churchill
> I thought that was 'Ending a sentence with a preposition is one thing up
> with which we must not put.'
After receiving a Minute issued by a priggish civil servant, objecting to
the ending of a sentence with a preposition and the use of a dangling
participle in official documents, Churchill red pencilled in the margin:
"This is the sort of pedantry up with which I will not put."
-- http://www.winstonchurchill.org/bonmots.htm#"Up with"
--
Martin DeMello
------------------------------
Date: 19 Jun 2000 02:41:31 GMT
From: fosterd@hartwick.edu (Decklin Foster)
Subject: Re: perl CGI on an Linux based apache webserver
Message-Id: <slrn8kr238.f6a.fosterd@photek.dhs.org>
Michael.Siemens <Michael.Siemens@nospamhome.com> writes:
> -rwxr-xr-x 1 root root 196 Jun 11 20:27 mail-form.pl
> root@csg:/usr/local/httpd/cgi-bin > ./mail-form.pl
> bash: ./mail-form.pl: No such file or directory
Yes, the command after #! on the first line of your file doesn't
exist.
Now, what was your Perl question?
--
There is no TRUTH. There is no REALITY. There is no CONSISTENCY. There
are no ABSOLUTE STATEMENTS. I'm very probably wrong. -- BSD fortune(6)
------------------------------
Date: Sun, 18 Jun 2000 22:31:20 GMT
From: phil.taylor@bigfoot.com (Philip Taylor)
Subject: Perl Performance using Objects
Message-Id: <394d4db5.24859648@news.demon.co.uk>
Is there any significant performance impact when developing software
as perl objects,typically I'm doing this:-
...
use common;
$common = common->new();
......
$result = $common->someMethod();
...
I have about 15 .pm files which I treat as objects. Some of my CGI
programs using as many as 6 .pm files at a time.
Any information is appreciated.
Phil
------------------------------
Date: 18 Jun 2000 22:51:18 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: Perl Performance using Objects
Message-Id: <8ijjp6$m2b$1@slb0.atl.mindspring.net>
Philip Taylor (phil.taylor@bigfoot.com) wrote:
: Is there any significant performance impact when developing software
: as perl objects,typically I'm doing this:-
:
: ...
: use common;
:
: $common = common->new();
: ......
: $result = $common->someMethod();
: ...
: I have about 15 .pm files which I treat as objects. Some of my CGI
: programs using as many as 6 .pm files at a time.
A method call is more time-consuming than an ordinary subroutine call
because the target has to be looked up dynamically in order to allow for
inheritance. However, that's unlikely to translate into a real
performance penalty unless you're doing method calls within long tight
loops. If you haven't already done so, familiarize yourself with the
Benchmark module, which will let you *measure* how long your code takes
rather than guessing about it.
------------------------------
Date: Mon, 19 Jun 2000 00:18:49 +0200
From: Abe Timmerman <abe@ztreet.demon.nl>
Subject: Re: Reintegrating win into CPAN (Was Re: What is the CPAN module repository (url) name that can beused for PPM/VPM?)
Message-Id: <eigqks42lrdpcrn70lh9h46vv17tvein0i@4ax.com>
On Sat, 20 May 2000 12:40:59 -0700, Jeff Zucker <jeff@vpservices.com>
wrote:
...
> So should CPAN itself
> consider including .ppd files, allowing authors to upload them along
> with the .gz files? Or even more radical -- should makeMaker or h2xs
> or something be modified in such a way that one could create a
> Makefile.PL that would accept a switch telling it whether it should run
> in makefile mode or ppd mode and if the later to essentially run ppm
> rather than creating a makefile.
It took me some time to find out what it actualy was that rang a bell
when I read this.
MakeMaker (5.005_03+) creates a 'ppd' target in the Makefile, when you
run 'perl MakeFile.PL'.
so you could do: 'nmake ppd', which is not very usefull on its own,
because you also need a .tar.gz with the ./blib hierarchy and that means
you'll need to do a 'nmake' and 'tar' as PPM is there for so called
'binary distributions'.
For personal use, the CPAN-shell looks easier to use.
Of course, it all works with _pure perl_ modules, I don't know if you
can build XS things for ActivePerl Win32 with any C-compiler (on Win32).
I think it would be nice if CPAN had a zip-repository, at least for the
_pure perl_ modules, but that would require the module author to have a
Win32 box with ActivePerl.
Oh well, at least now I know how it's done ... :-)
--
Good luck,
Abe
------------------------------
Date: Mon, 19 Jun 2000 00:36:01 GMT
From: Elaine Ashton <elaine@chaos.wustl.edu>
Subject: Re: Reintegrating win into CPAN (Was Re: What is the CPAN module repository (url) name that can beused for PPM/VPM?)
Message-Id: <B572E32F.67E7%elaine@chaos.wustl.edu>
in article 394c60ac.3385464@news.ncf.carleton.ca, Steve A. Taylor at
an400@freenet.carleton.ca quoth:
> On 22 May 2000 19:04:17 -0500, Jeph <jeph@ucool.com> wrote:
>>> http://www.bi.umist.ac.uk/packages. Simon's repository is listed on
>>> www.perl.com, but not on CPAN, AFAIK. And if one uses cpan.search.org,
>>> the .ppd files are, of course, not listed. So should CPAN itself
>>> consider including .ppd files, allowing authors to upload them along
>>> with the .gz files? Or even more radical -- should makeMaker or h2xs
I don't know of any restrictions keeping authors from uploading packages
to CPAN with the source, but consider that people already complain about
how huge CPAN has gotten size-wise. Mirrors may not want to host CPAN if
it grows to gargantuan proportions.
> The ppm avenue puts "module control" in the hands of ActiveState,
> which needs to survive fiinancially as we try to update free modules.
AS doesn't sell the modules to my knowledge. As a consumer, you might
request that they update their packages regularly.
e.
------------------------------
Date: Mon, 19 Jun 2000 11:07:24 +1000
From: "Phil Sutcliffe" <ils@gil.com.au>
Subject: Re: simple array question
Message-Id: <394d7274_1@news.bne.gil.com.au>
Hi Jason,
Thanks for the reply, but it doesn't really answer my question.
What I need is to get the data "GBH" "QLD" "1234" into variables called
$company $state and $postcode.
I am modifying existing code and the task to change every occurance of
$company to $details{company} will not be a trivial one.
Do you have any other suggestions?
Thanks,
Phil.
----- Original Message -----
From: "jason" <elephant@squirrelgroup.com>
Newsgroups: comp.lang.perl.misc
Sent: Sunday, June 18, 2000 4:23 PM
Subject: Re: simple array question
> Phil Sutcliffe writes ..
> >Consider this.
> >
> >@fields=("GBH","QLD","1234");
> >
> >@names=("\$company","\$state","\$postcode");
> >
> >Is there a way to get "GBH" into variable $company without using loops.
> >
> >I realise I can do this
> >
> >${$names[0]} = $fields[0];
> >
> >What I'm looking for is something like
> >
> >\@names = @fields; to get all the elements of @fields into the field
names
> >contained in @names
> >
> >Is there a simple one-liner to do this?
>
> there's a one liner .. but it's still a loop .. but the question that
> your code really raises is - why aren't you using a hash ?
>
> #!/usr/bin/perl -w
> use strict;
>
> my @fields = qw/GBH QLD 1234/;
> my @names = qw/company state postcode/;
>
> my %details = ();
>
> @details{@names} = @fields;
>
> print "$details{company} is in state $details{state} with postcode "
> , "$details{postcode}\n";
>
> __END__
>
> --
> jason - elephant@squirrelgroup.com -
"Phil Sutcliffe" <ils@gil.com.au> wrote in message
news:394843b8_1@news.bne.gil.com.au...
> Hi,
>
> Consider this.
>
> @fields=("GBH","QLD","1234");
>
> @names=("\$company","\$state","\$postcode");
>
> Is there a way to get "GBH" into variable $company without using loops.
>
> I realise I can do this
>
> ${$names[0]} = $fields[0];
>
> What I'm looking for is something like
>
> \@names = @fields; to get all the elements of @fields into the field names
> contained in @names
>
> Is there a simple one-liner to do this?
>
> TIA,
>
> Phil.
>
>
------------------------------
Date: Mon, 19 Jun 2000 12:07:16 +1000
From: "Phil Sutcliffe" <ils@gil.com.au>
Subject: Re: simple array question
Message-Id: <394d8091_1@news.bne.gil.com.au>
I have achieved the desired result using eval.
eval "(" . join(",",@names) . ") = \@fields;";
I would still like to know if this can be done using references.
Thanks,
Phil.
"jason" <elephant@squirrelgroup.com> wrote in message
news:MPG.13b708097b2ee70f989744@news...
> Phil Sutcliffe writes ..
> >Consider this.
> >
> >@fields=("GBH","QLD","1234");
> >
> >@names=("\$company","\$state","\$postcode");
> >
> >Is there a way to get "GBH" into variable $company without using loops.
> >
> >I realise I can do this
> >
> >${$names[0]} = $fields[0];
> >
> >What I'm looking for is something like
> >
> >\@names = @fields; to get all the elements of @fields into the field
names
> >contained in @names
> >
> >Is there a simple one-liner to do this?
>
> there's a one liner .. but it's still a loop .. but the question that
> your code really raises is - why aren't you using a hash ?
>
> #!/usr/bin/perl -w
> use strict;
>
> my @fields = qw/GBH QLD 1234/;
> my @names = qw/company state postcode/;
>
> my %details = ();
>
> @details{@names} = @fields;
>
> print "$details{company} is in state $details{state} with postcode "
> , "$details{postcode}\n";
>
> __END__
>
> --
> jason - elephant@squirrelgroup.com -
------------------------------
Date: Sun, 18 Jun 2000 17:31:38 -0700
From: Agentkhaki <altavistaNOalSPAM@agentkhaki.com.invalid>
Subject: What the...
Message-Id: <17599f0b.81a2eb83@usw-ex0109-070.remarq.com>
Perhaps someone can help me out here.
Go to http://www.agentkhaki.com/xero/cgitest.html and fill
in the form with bogus info, and click submit. Why am I
getting this?
Here's the source of my script and the library I'm using:
http://www.agentkhaki.com/xero/create_user.html
http://www.agentkhaki.com/xero/datahandler_cu.html
You can view the source of the cgitest.html just by hitting
view source.
I'm sure it's something dumb. I'm new to this.
* Sent from AltaVista http://www.altavista.com Where you can also find related Web Pages, Images, Audios, Videos, News, and Shopping. Smart is Beautiful
------------------------------
Date: Sun, 18 Jun 2000 20:07:01 -0500
From: Nnickee <nnickee@nnickee.com>
Subject: Re: What the...
Message-Id: <E8FCFFBE656A4551.BBA20106977F2A70.5837430BF16D5023@lp.airnews.net>
On Sun, 18 Jun 2000 17:31:38 -0700, someone claiming to be Agentkhaki
<altavistaNOalSPAM@agentkhaki.com.invalid> said:
>Perhaps someone can help me out here.
>Go to http://www.agentkhaki.com/xero/cgitest.html and fill
>in the form with bogus info, and click submit. Why am I
>getting this?
"exec() returned: 2: No such file or directory"
Hmmm... <scratching head> ... it would seem to me that a file or
directory referenced in your script doesn't exist on the server (or at
least doesn't exist where your script expects it to).
>Here's the source of my script and the library I'm using:
>http://www.agentkhaki.com/xero/create_user.html
404 - file not found.
>http://www.agentkhaki.com/xero/datahandler_cu.html
404 - file not found.
Hmmm... I wonder if that has anything to do with the "no such file or
directory" message from above?
>You can view the source of the cgitest.html just by hitting
>view source.
Why would we want to view cgitest.html's source? If you have a perl
related question then we would want to view the source of your perl
script, namely create_user.pl.
>I'm sure it's something dumb. I'm new to this.
------------------------------
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 3416
**************************************