[16889] in Perl-Users-Digest
Perl-Users Digest, Issue: 4301 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Sep 12 18:10:42 2000
Date: Tue, 12 Sep 2000 15:10:27 -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: <968796627-v9-i4301@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Tue, 12 Sep 2000 Volume: 9 Number: 4301
Today's topics:
Hash of Hash of Hash <nico.rittner@h-pro.de>
Re: Hash of Hash of Hash <anders@wall.alweb.dk>
Re: Hash of Hash of Hash <vmurphy@Cisco.Com>
Re: help in writing a card game (Tony L. Svanstrom)
Re: help in writing a card game <godzilla@stomp.stomp.tokyo>
Re: help in writing a card game <godzilla@stomp.stomp.tokyo>
HELP! urgent but easy <j.pfeiffer@roadtv.de>
how to remove unprintable chars with Perl script <d.gardenier@iae.nl>
Re: how to remove unprintable chars with Perl script <red_orc@my-deja.com>
Re: Incremental HTML output as script is running michaeld@brown-cole.com
Re: Incremental HTML output as script is running <news@flish.co.uk>
Re: insert hyphen between variables nobull@mail.com
Re: insert hyphen between variables <tim@ipac.caltech.edu>
Re: insert hyphen between variables <gpitmanNO@SPAMnb.net>
Re: insert hyphen between variables <tony_curtis32@yahoo.com>
Re: insert hyphen between variables <peter@wastholm.com>
Re: Is there a file rename function? <elephant@squirrelgroup.com>
Keyed list ala Tcl charlie.bursell@healthcare.com
Re: Keyed list ala Tcl <anders@wall.alweb.dk>
Learning arrays/lists is Perl and pointers/arrays in C <iltzu@sci.invalid>
Re: LINK OK/BAD <gellyfish@gellyfish.com>
Re: min function <cmcurtin@interhack.net>
Re: min function <jeffp@crusoe.net>
Re: min function nobull@mail.com
Re: min function (brian d foy)
Re: min function <elephant@squirrelgroup.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 12 Sep 2000 22:37:45 +0200
From: "news.t-online.de" <nico.rittner@h-pro.de>
Subject: Hash of Hash of Hash
Message-Id: <8pm3kb$hnk$12$1@news.t-online.com>
Hi,
one small question about combining hashes.
What i already know is that the following works:
%hash=(student => {name=> "nico"},
{age => "23},
...
and so on
but does it also work to extend the "hash depth"
%site_cfg = (
tbl_firmenindex=> ("name" => "_swbpark_newsflash"),
("fields" =>( "name" => "Name",
"strasse" => "Strasse")),
....
and accessing it by %site_cfg{'fields'}{'name'}
i tried it out , but did not get it working.
Nico
--
))|((
(ó ò)
#---ooO-(_)-Ooo----------------------------------------------------#
h-pro
.oooO Postfach 2215 e-Mail: nico.rittner@h-pro.de
( ) Oooo. D-14738 Brandenburg Web: http://www.h-pro.de
#-\ (----( )-----------------------------------------------------#
\_) ) /
(_/
------------------------------
Date: Tue, 12 Sep 2000 20:45:52 GMT
From: Anders Lund <anders@wall.alweb.dk>
Subject: Re: Hash of Hash of Hash
Message-Id: <4Cwv5.814$Oh1.11294@news000.worldonline.dk>
news.t-online.de wrote:
> Hi,
>
> one small question about combining hashes.
>
> What i already know is that the following works:
>
> %hash=(student => {name=> "nico"},
> {age => "23},
> ...
> and so on
>
> but does it also work to extend the "hash depth"
>
> %site_cfg = (
>
> tbl_firmenindex=> ("name" => "_swbpark_newsflash"),
>
> ("fields" =>( "name" => "Name",
> "strasse" => "Strasse")),
> ....
>
> and accessing it by %site_cfg{'fields'}{'name'}
>
> i tried it out , but did not get it working.
>
>
> Nico
>
>
> --
>
> ))|((
> (ó ò)
> #---ooO-(_)-Ooo----------------------------------------------------#
> h-pro
> .oooO Postfach 2215 e-Mail: nico.rittner@h-pro.de
> ( ) Oooo. D-14738 Brandenburg Web: http://www.h-pro.de
> #-\ (----( )-----------------------------------------------------#
> \_) ) /
> (_/
>
>
>
>
$perldoc perlref
-anders
--
[ the word wall - and the trailing dot - in my email address
is my _fire_wall - protecting me from the criminals abusing usenet]
------------------------------
Date: 12 Sep 2000 17:09:20 -0400
From: Vinny Murphy <vmurphy@Cisco.Com>
Subject: Re: Hash of Hash of Hash
Message-Id: <u8zsxb9mn.fsf@Cisco.Com>
>>>>> "nico" == news t-online de <nico.rittner@h-pro.de> writes:
nico> Hi, one small question about combining hashes.
nico> What i already know is that the following works:
nico> %hash=(student => {name=> "nico"}, {age => "23}, ... and so
nico> on
nico> but does it also work to extend the "hash depth"
nico> %site_cfg = (
nico> tbl_firmenindex=> ("name" => "_swbpark_newsflash"),
nico> ("fields" =>( "name" => "Name", "strasse"
nico> => "Strasse")), ....
nico> and accessing it by %site_cfg{'fields'}{'name'}
nico> i tried it out , but did not get it working.
try
my %site_cfg =
(
tbl_firmenindex => { "name" => "_swbpark_newsflash" },
"fields" => { "name" => "Name",
"strasse" => "Strasse",
"address" =>
{
street => 'Sesame Street',
city => 'New York',
state => 'New York',
}
}
);
print $site_cfg{fields}{address}{street}, " ",
$site_cfg{fields}{address}{city}, "\n";
set perldoc perllol for more details.
-vjm
------------------------------
Date: Tue, 12 Sep 2000 20:12:55 +0200
From: tony@svanstrom.com (Tony L. Svanstrom)
Subject: Re: help in writing a card game
Message-Id: <1egv3z3.1kg4fz51lvm7xvN%tony@svanstrom.com>
Godzilla! <godzilla@stomp.stomp.tokyo> wrote:
<cut]
Isn't this thing worrying y'all? The new ones in c.l.p.m might actually
start listening to this one and start getting "good" advice via
e-mail... And judging from what's been said lately that would mean
semi-working Perl4 code.
/Tony
--
/\___/\ Who would you like to read your messages today? /\___/\
\_@ @_/ Protect your privacy: <http://www.pgpi.com/> \_@ @_/
--oOO-(_)-OOo---------------------------------------------oOO-(_)-OOo--
on the verge of frenzy - i think my mask of sanity is about to slip
---ôôô---ôôô-----------------------------------------------ôôô---ôôô---
\O/ \O/ ©99-00 <http://www.svanstrom.com/?ref=news> \O/ \O/
------------------------------
Date: Tue, 12 Sep 2000 11:29:08 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: help in writing a card game
Message-Id: <39BE75F4.4C6C3192@stomp.stomp.tokyo>
Tony L. Svanstrom whined:
> Godzilla! wrote:
> <cut]
> Isn't this thing worrying y'all? The new ones in c.l.p.m might actually
> start listening to this one and start getting "good" advice via
> e-mail... And judging from what's been said lately that would mean
> semi-working Perl4 code.
Oh my, such a stereotypical fragile male ego. Reads to me
you are insanely jealous of my talents in Perl programming,
little boy.
Godzilla!
--
Androids And More
http://la.znet.com/~callgirl/android.html
------------------------------
Date: Tue, 12 Sep 2000 12:26:36 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: help in writing a card game
Message-Id: <39BE836C.ADFB0940@stomp.stomp.tokyo>
Kelley Kent wrote:
> So I was bored last night and decided to write
> a card program in Perl....
(snipped)
> Any thoughts? Ideas? Suggestions? Comments
> from the peanut gallery? :-)
Are you sure you are not my ace news reporter,
Bark Bent? Such an obvious yet harmless troll.
If yours wasn't such a blatant troll article,
I might be tempted to discuss complex algorithms.
You have 52 cards in a deck consisting of 2 sets,
16 face cards and 36 number cards. Within these
2 sets you have 4 sub-sets of suit types, heart,
diamond, club, spade. Each suit sub-set consists
of 4 of each, equal value face cards and equal
value number cards. Backwards you have 4 sets of
cards, each set populated by 4 face cards
and 9 number cards.
A good start on this, the only logical start, is
to write algorithms which will calculate this
combination of odds and deal one card correctly
per odds for number cards versus face cards and
one in four odds of a certain suit.
Remove one card, my favorite and my personal icon,
the Queen of Diamonds. Do you think you can write
another set of algorithms which will recalculate
now different odds, number vs. face, of a certain
suit, with one face card, a Queen of Diamonds,
missing from your deck?
Suppose algorithms from there on, for dealing
out, oh, five cards, not dealing the same card
twice and, later, not dealing a dealt or discarded
card again, until a new shuffle, would be a rather
challenging mathematical problem in tracking dynamic
constantly changing multiple sets of odds.
You could possibly do this with associative arrays
as you suggest, using numbers for number cards,
letters for face cards and letters for suits. However,
after a few dealt hands, you will notice your script
slowing down and memory consumption increasing quite
dramatically. In time, before you need to shuffle for
a fresh deck, your script will nearly come to a stop.
Godzilla!
--
print "http://3483852801/%7e%63%61ll%67i%72l";
------------------------------
Date: Tue, 12 Sep 2000 22:44:16 +0200
From: joerg pfeiffer <j.pfeiffer@roadtv.de>
Subject: HELP! urgent but easy
Message-Id: <39BE959F.A7DD6A14@roadtv.de>
all i got to know is:
how do i check if a file exists on another server??
if (-e "http://www.domain.de/tage/$welchertag.html") didnt work.
joerg
------------------------------
Date: Tue, 12 Sep 2000 22:58:23 +0200
From: "Durk Gardenier" <d.gardenier@iae.nl>
Subject: how to remove unprintable chars with Perl script
Message-Id: <8pm5ii$6k0$1@news.IAEhv.nl>
This initially seemed easy , but it has taken
me quite some time and I still have not found
an answer.
If a file contains unprintable characters, how can I
remove them with a perl script?
I hope you can help.
Regards,
Durk
------------------------------
Date: Tue, 12 Sep 2000 21:39:46 GMT
From: Rodney Engdahl <red_orc@my-deja.com>
Subject: Re: how to remove unprintable chars with Perl script
Message-Id: <8pm7qu$i1b$1@nnrp1.deja.com>
In article <8pm5ii$6k0$1@news.IAEhv.nl>,
"Durk Gardenier" <d.gardenier@iae.nl> wrote:
> This initially seemed easy , but it has taken
> me quite some time and I still have not found
> an answer.
>
> If a file contains unprintable characters, how can I
> remove them with a perl script?
>
you could try a regular expression and specify the characters you want
to remove:
$var = "a bunch of characters, and considering the 'c' and 'e' to be
unprintable for example.";
$var =~ s/(?:c|e)//g;
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 12 Sep 2000 19:53:12 GMT
From: michaeld@brown-cole.com
Subject: Re: Incremental HTML output as script is running
Message-Id: <8pm1iu$a2n$1@nnrp1.deja.com>
In article <MPG.142880869191d76598968a@alt-news.gradwell.net>,
Andy Flisher <news@flish.co.uk> wrote:
> Cheers for the tip, I had a hunt today and managed to find a lot of
> copies of the same syntax and usage doc (but unfortunately no live
> examples :-( ) so I rigged it up, and again it works a treat offline,
I had almost exactly the same problem. I solved it with proc::daemon.
Essentially I built a cgi "wrapper" script that set a lock file,
started a "status" page, and then executed the real script in the
background as a daemon using proc::daemon. The script would then
output its updates to the status page. The status page was plain html
with a 5 second refresh or something. The list thing the script did
was kill the lockfile and remove the refresh tag from the status page.
I'll email the scripts to you for your perusal.
--
--------------------------
michaeld_at_brown-cole.com
binky_at_bingo-lan.org
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 12 Sep 2000 22:03:12 +0100
From: Andy Flisher <news@flish.co.uk>
Subject: Re: Incremental HTML output as script is running
Message-Id: <MPG.1428aa68db60029a98968b@alt-news.gradwell.net>
On perusing <8pm1iu$a2n$1@nnrp1.deja.com>, michaeld@brown-cole.com was
heard to mumble...
> I'll email the scripts to you for your perusal.
Thanks, would be appreciated.
Suspect I'm gonna have to rethink the costings for this job though, way
too much time going in for what I (obviously incorrectly) thought would
be a simple practice.
Really must start planning these things out in my head before jumping in
;-(
--
Andy Flisher
'All postings are a reflection of my state of mind,
and not necessarily of any worthwhile opinion'
news@flish.co.uk http://www.flish.co.uk
------------------------------
Date: 12 Sep 2000 19:17:11 +0100
From: nobull@mail.com
Subject: Re: insert hyphen between variables
Message-Id: <u9pum9326w.fsf@wcl-l.bham.ac.uk>
Gary <gapno@spamnb.net> writes:
> I am trying to get a hyphen between the 2 variables on one side of the
> hash.
Do you mean a hyphen or a the word HYPHEN.
> "$nameHYPHEN$fname"
To put in a hyphen
"$name-$fname"
To put in the word HYPHEN
"${name}HYPHEN$fname"
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Tue, 12 Sep 2000 12:42:05 -0700
From: Tim Conrow <tim@ipac.caltech.edu>
Subject: Re: insert hyphen between variables
Message-Id: <39BE870D.10790914@ipac.caltech.edu>
Gary wrote:
> ... [snip]
> I am trying to get a hyphen between the 2 variables on one side of the hash.
> i cant single quote or escape it to get it to work.
> ... [snip]
> $states{$sidnum} = ("$nameHYPHEN$fname");
$states{$sidnum} = "$name-$fname";
What, exactly, is the problem?
--
-- Tim Conrow tim@ipac.caltech.edu |
------------------------------
Date: Tue, 12 Sep 2000 17:44:36 -0400
From: "Gary" <gpitmanNO@SPAMnb.net>
Subject: Re: insert hyphen between variables
Message-Id: <smxv5.453$Hs2.1067@newsfeed.slurp.net>
That gives me a 0 (zero) it subtracts, Try it. Once again. thanks Mr. Lund
for a usable reply.
The sarcasm here is wonderful.
"Tim Conrow" <tim@ipac.caltech.edu> wrote in message
news:39BE870D.10790914@ipac.caltech.edu...
> Gary wrote:
> > ... [snip]
> > I am trying to get a hyphen between the 2 variables on one side of the
hash.
> > i cant single quote or escape it to get it to work.
> > ... [snip]
> > $states{$sidnum} = ("$nameHYPHEN$fname");
>
> $states{$sidnum} = "$name-$fname";
>
> What, exactly, is the problem?
>
> --
>
> -- Tim Conrow tim@ipac.caltech.edu |
------------------------------
Date: 12 Sep 2000 16:51:49 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: insert hyphen between variables
Message-Id: <8766o1l1my.fsf@limey.hpcc.uh.edu>
>> On Tue, 12 Sep 2000 17:44:36 -0400,
>> "Gary" <gpitmanNO@SPAMnb.net> said:
> That gives me a 0 (zero) it subtracts, Try it. Once
> again. thanks Mr. Lund for a usable reply. The sarcasm
> here is wonderful. "Tim Conrow" <tim@ipac.caltech.edu>
>> $states{$sidnum} = "$name-$fname";
$name = 'tony';
$fname = 'curtis';
$rhs = "$name-$fname";
print "$rhs\n";
=> tony-curtis
$name = 5;
$fname = 1;
$rhs = "$name-$fname";
print "$rhs\n";
=> 5-1
Clearly, it doesn't subtract.
hth
t
--
WWNKD?
------------------------------
Date: Tue, 12 Sep 2000 22:05:47 GMT
From: Peter Wastholm <peter@wastholm.com>
Subject: Re: insert hyphen between variables
Message-Id: <39BEA830.5AF7EB3D@wastholm.com>
Gary wrote:
>
> That gives me a 0 (zero) it subtracts, Try it. Once again. thanks Mr. Lund
> for a usable reply.
Are you sure you included the quotes?
> > $states{$sidnum} = "$name-$fname";
/Peter
------------------------------------------------------------------------
Peter Wastholm Parkinson's First Law: Work expands to fill the time
peter@wastholm.com available. C. Northcote Parkinson
"Aphorisms Galore!" -- Feed Your Wit http://www.aphorismsgalore.com/
------------------------------
Date: Wed, 13 Sep 2000 08:07:46 +1100
From: jason <elephant@squirrelgroup.com>
Subject: Re: Is there a file rename function?
Message-Id: <MPG.14293818b2e582b598978d@localhost>
Tom Christiansen <tchrist@perl.com> wrote ..
>In article <MPG.142817528c751b8d989778@localhost>,
>jason <elephant@squirrelgroup.com> wrote:
>>or the existing tools on a system without 'grep'
>
>There are none without grep, nay, not one, for behold here a Grep
>for All Systems:
>
> % perl -ne 'INIT{$p=shift} print if /$p/o' pattern file1 file2 ...
>
>Voilà. C'est tout. There's nothing else to it. There's no
>excuse for not being able to grep. None at all.
thanks Tom .. but I have a C rewrite of grep .. I notice that you don't
address the missing 'man' though ;)
btw .. I downloaded your new perlman alpha .. but the TAR seemed to be
missing the /bin/ subdirectory altogether .. I would otherwise be
convinced that it was a dodgy tar - but because it's you - you've got me
doubting my WinZip's ability to untar
can you confirm that
http://doriath.perl.com/misc/perlman-alpha0.tar.gz
contains a /bin/ and all the files in it (I guess at least perlman .. I
don't know what else is there to get the magical perlXXX behaviour)
--
jason -- elephant@squirrelgroup.com --
------------------------------
Date: Tue, 12 Sep 2000 19:23:36 GMT
From: charlie.bursell@healthcare.com
Subject: Keyed list ala Tcl
Message-Id: <8plvqv$7ru$1@nnrp1.deja.com>
Does anyone know of a library to do keyed list ala Tcl?
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 12 Sep 2000 19:49:18 GMT
From: Anders Lund <anders@wall.alweb.dk>
Subject: Re: Keyed list ala Tcl
Message-Id: <2Nvv5.707$Tn3.15376@news010.worldonline.dk>
charlie.bursell@healthcare.com wrote:
> Does anyone know of a library to do keyed list ala Tcl?
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
ever heard the word "hash"?
-anders
--
[ the word wall - and the trailing dot - in my email address
is my _fire_wall - protecting me from the criminals abusing usenet]
------------------------------
Date: 12 Sep 2000 18:40:58 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Learning arrays/lists is Perl and pointers/arrays in C
Message-Id: <968782112.12610@itz.pp.sci.fi>
In article <slrn8ro0bi.k2.tim@degree.ath.cx>, Tim Hammerquist wrote:
>kj0 <kj0@mailcity.com> wrote:
>> I had a similar problem when learning C, because the first book I used
>> did a very poor job clarifying the difference between pointers and
>> arrays. So for the first months as a C programmer I was always
>> tripping, and then I read Harbison & Steele and all was clear. But
>> the Harbison & Steele of Perl is yet to be written, alas.
>
>Trying to imagine a book that could fail to distinguish clearly between
>C arrays and C pointers...
>
>Alright, an unindexed C array simply returns a pointer to the first
>element of the array. Is this what you're referring to?
It's quite easy to confuse arrays and pointers in C, particularly when
you get to complicated stuff like multidimensional arrays. In Perl,
newbies are confused enough by the fact that there are actually only
trees of arrays of references. Now think about C, where you can have
either true arrays of arrays, or Perlish arrays of pointers to arrays,
and *the indexing syntax is identical in either case*.
>After running this little program, I was reminded of how interchangeable
>C char arrays and char pointers are. However, AFAIK this only applies
>to char[] and char*. I've found that indexing a dereferenced int*:
>
> int* x = new int(5);
> x[0];
>
>...does not cause any errors. But any attempt to _use_ the indexed pointer
>caused a segmentation fault.
Well, that must be a C++ thing. Works just fine in plain C:
#include <stdio.h>
int main(int argc, char *argv[]) {
int i = 5;
int *p = &i;
printf("%i\n", p[0]);
return 0;
}
If you thought that's weird, you haven't seen the really odd parts of
C array handling, like commutativity:
#include <stdio.h>
int main(int argc, char *argv[]) {
int i = 0;
while (i < 14)
putchar(i++["Hello, world!\n"]);
return 0;
}
This is one of the things in C that I occasionally miss in Perl. It
has such great obfuscation potential..
--
Ilmari Karonen - http://www.sci.fi/~iltzu/
Please ignore Godzilla | "By promoting postconditions to
and its pseudonyms - | preconditions, algorithms become
do not feed the troll. | remarkably simple." -- Abigail
------------------------------
Date: 12 Sep 2000 06:55:55 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: LINK OK/BAD
Message-Id: <8pkghb$1qd$1@orpheus.gellyfish.com>
On Wed, 06 Sep 2000 13:02:33 +0200 Piotr Pudelko wrote:
> How I can check that other web links/150 links/ on my web is ok or bad.
> I search the perl modul or other that I can send and read status of
> links questions/I can't read all HTLM only header HTTP - like a
> emulation of NS4/IE4/
>
Probably some combination of LWP::UserAgent and HTML::LinkExtor.
/J\
--
yapc::Europe in assocation with the Institute Of Contemporary Arts
<http://www.yapc.org/Europe/> <http://www.ica.org.uk>
------------------------------
Date: 12 Sep 2000 14:15:30 -0400
From: Matt Curtin <cmcurtin@interhack.net>
Subject: Re: min function
Message-Id: <xlxaeddbhod.fsf@gold.cis.ohio-state.edu>
>>>>> "Randal" == Randal L Schwartz <merlyn@stonehenge.com> writes:
Jeff> 4 0 21 3 -2 18
Jeff> how would YOU determine the smallest? Write your function in
Jeff> the same manner.
Randal> (Fires up Squeak)
Randal> (open workspace)
Randal> {4. 0. 21. 3. -2. 18} min
Randal> (press command-P for "print it")
Randal, Randal, Randal... I know you're in Emacs.
Just stick a "min" in front, smack some parens around it and evaluate
it.
(min 4 0 21 3 -2 18) => -2
(Now ducking *twice*...)
--
Matt Curtin cmcurtin@interhack.net http://www.interhack.net/people/cmcurtin/
------------------------------
Date: Tue, 12 Sep 2000 14:55:59 -0400
From: Jeff Pinyan <jeffp@crusoe.net>
Subject: Re: min function
Message-Id: <Pine.GSO.4.21.0009121453370.12441-100000@crusoe.crusoe.net>
On Sep 12, Stephen Kloder said:
(as well as brian d foy)
>Jeff Pinyan wrote:
>
>>
>> You poor, poor soul. I'd have done
>>
>> def min (seq):
>> """returns minimum of a list of numbers"""
>> if type(seq) != type(()): seq = tuple(seq)
>> if seq == (): return None
>> return reduce(lambda A,B: (A,B)[A>B], seq[1:], seq[0])
>>
>> I think I'll run for cover.
>>
>
>You'd better. You could have just done:
>>>> min(4,0,21,3,-2,18)
>-2
$post->setTone(M_EVIL);
$post->say(
"Why does Python have a built-in min() function, but Perl doesn't? ;)"
);
--
Jeff "japhy" Pinyan japhy@pobox.com http://www.pobox.com/~japhy/
PerlMonth - An Online Perl Magazine http://www.perlmonth.com/
The Perl Archive - Articles, Forums, etc. http://www.perlarchive.com/
CPAN - #1 Perl Resource (my id: PINYAN) http://search.cpan.org/
------------------------------
Date: 12 Sep 2000 19:53:09 +0100
From: nobull@mail.com
Subject: Re: min function
Message-Id: <u9k8ch30iy.fsf@wcl-l.bham.ac.uk>
Shawn Ribordy <Ribordy_Shawn_C@cat.com> writes:
> Tom Christiansen wrote:
>
> > In article <39BE2535.5BF72AF3@cat.com>,
> > Shawn Ribordy <Ribordy_Shawn_C@cat.com> wrote:
> > >I have looked all over the place, and I cannot find a min function.
For sufficiently small values "all over the place"! You've not even looked
for the word "min" in the module list on CPAN.
> > Are you saying you don't know how to write one?
>
> Of course I could write one! - but why reinvent the wheel right! Isn't
> laziness still a virtue of all programmers.
It is. That's why we have CPAN.
Note the word "min" appears only twice in
http://www.cpan.org/modules/00modlist.long.html
so it ain't exactly gonna take you long to find the module.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Tue, 12 Sep 2000 16:45:18 -0400
From: brian@smithrenaud.com (brian d foy)
Subject: Re: min function
Message-Id: <brian-ya02408000R1209001645180001@news.panix.com>
In article <Pine.GSO.4.21.0009121453370.12441-100000@crusoe.crusoe.net>, japhy@pobox.com posted:
> $post->setTone(M_EVIL);
> $post->say(
> "Why does Python have a built-in min() function, but Perl doesn't? ;)"
> );
that's okay. you have to include all sorts of Python classes to
get some of the stuff Perl has built-in. :)
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Mongers <URL:http://www.perl.org/>
------------------------------
Date: Wed, 13 Sep 2000 08:33:42 +1100
From: jason <elephant@squirrelgroup.com>
Subject: Re: min function
Message-Id: <MPG.14293e2d7e9e1bf798978f@localhost>
Tom Christiansen <tchrist@perl.com> wrote ..
>In article <39BE321E.5324273C@cat.com>,
>Shawn Ribordy <Ribordy_Shawn_C@cat.com> wrote:
>>Of course I could write one! - but why reinvent the wheel right!
>
>Reinvent what wheel? If this requires invention, you're working
>far, far too hard. That's like asking whether someone knows how
>to determine whether a number is odd, and not liking that there's
>no plug-and-pray module to throw at it. Trivial problems should
>not require canned, opaque solutions.
talk about "getting back to C" .. when someone's scoffed at for guessing
that there might be a 'min' function in Perl
how many functions are there in Perl that solve trivial problems (more
quickly and more reliably that home-rolled solutions) ? .. here's a few
shift
unshift
pop
push
chomp
chop
length
join
and want a 'canned, opaque solution' ? .. try open() .. egads!!!
--
jason -- elephant@squirrelgroup.com --
------------------------------
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 4301
**************************************