[13183] in Perl-Users-Digest
Perl-Users Digest, Issue: 593 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Aug 19 20:07:14 1999
Date: Thu, 19 Aug 1999 17:05:15 -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, 19 Aug 1999 Volume: 9 Number: 593
Today's topics:
Re: Attn: CRAP (was Re: voting system pealse advise) collinf@moscow.com
Re: Attn: CRAP (was Re: voting system pealse advise) <uri@sysarch.com>
Re: cannot write description to eventlog (elephant)
Re: directory reading <makkulka@cisco.com>
Re: GDBM Access in Perl (Benjamin Franz)
Re: HARASSMENT -- Monthly Autoemail <acinorev@earthling.net>
Re: HARASSMENT -- Monthly Autoemail; Spammer Defiant (Miguel Cruz)
Re: How can I connect to NT machine's registry remotely (elephant)
How Test If Function Exists? <stowians@ford.com>
Re: How Test If Function Exists? <tchrist@mox.perl.com>
Re: Packages and parent packages (Donovan Rebbechi)
Parse ANSI X12N 837 claim files (Scott Erickson)
Re: Parse ANSI X12N 837 claim files <makkulka@cisco.com>
Re: Parse ANSI X12N 837 claim files (Scott Erickson)
Re: Perl Exam Beta Testers Required <uri@sysarch.com>
Re: Perl Exam Beta Testers Required (Marcel Grunauer)
Re: perl system() <cassell@mail.cor.epa.gov>
Re: Q:Two perl programs printing to one txt file (elephant)
Request for Comments: www.perl.com <tchrist@mox.perl.com>
Simple, dumb newbe question... how do I... <rwilliamson@uno.gers.com>
Re: statistical sorts (Eric Bohlman)
Re: system or exec??? Many defunct processes... jay_ethridge@my-deja.com
Re: Testing if a module is installed <rootbeer@redcat.com>
Re: Wacky Programming Tales (Eric Bohlman)
Re: what does eq do on lists? (Sam Holden)
Re: what does eq do on lists? (Sam Holden)
Re: Why would this autovivify - answers? opinions? <d-edwards@uchicago.edu>
Re: Why would this autovivify - answers? opinions? <makkulka@cisco.com>
Re: win32 Net::SMTP <ez062634@mailbox.ucdavis.edu>
Re: Win32::SerialPort tutorial and tpj.com <dchristensen@california.com>
Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 19 Aug 1999 21:52:52 GMT
From: collinf@moscow.com
Subject: Re: Attn: CRAP (was Re: voting system pealse advise)
Message-Id: <7phubk$6qm$1@news.fsr.net>
Uri Guttman <uri@sysarch.com> wrote:
> m> print "Content-type: text/html\n\n";
> m> if ($FORM{'action'} eq "admin") { &admin; }
> m> elsif ($FORM{'action'} eq "add_topic") { &add_topic; }
> m> elsif ($FORM{'action'} eq "showvote") { &showvote; }
> m> elsif ($FORM{'action'} eq "others") { &others; }
> m> elsif ($FORM{'action'} eq "vote") { &vote; }
> m> elsif ($FORM{'action'} eq "results") { &results; }
> m> elsif ($FORM{'action'} eq "delete") { &delete; }
> UGLY! make this into a dispatch hash.
Could you explain what a 'dispatch hash' is?
--
.signature Collin Forbes
------------------------------
Date: 19 Aug 1999 17:58:42 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Attn: CRAP (was Re: voting system pealse advise)
Message-Id: <x7pv0jv3e5.fsf@home.sysarch.com>
>>>>> "c" == collinf <collinf@moscow.com> writes:
c> Uri Guttman <uri@sysarch.com> wrote:
m> print "Content-type: text/html\n\n";
m> if ($FORM{'action'} eq "admin") { &admin; }
m> elsif ($FORM{'action'} eq "add_topic") { &add_topic; }
m> elsif ($FORM{'action'} eq "showvote") { &showvote; }
m> elsif ($FORM{'action'} eq "others") { &others; }
m> elsif ($FORM{'action'} eq "vote") { &vote; }
m> elsif ($FORM{'action'} eq "results") { &results; }
m> elsif ($FORM{'action'} eq "delete") { &delete; }
c> Could you explain what a 'dispatch hash' is?
%form_action = (
'add_topic' => \&add_topic,
'showvote' => \&showvote,
'others' => \&others,
'vote' => \&vote,
'results' => \&results,
'delete' => \&delete,
) ;
$form_action{$FORM{'action'}}->() ;
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
uri@sysarch.com --------------------------- Perl, Internet, UNIX Consulting
Have Perl, Will Travel ----------------------------- http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com
"F**king Windows 98", said the general in South Park before shooting Bill.
------------------------------
Date: Fri, 20 Aug 1999 09:08:32 +1000
From: elephant@squirrelgroup.com (elephant)
Subject: Re: cannot write description to eventlog
Message-Id: <MPG.12273980ecba0ce5989c5e@news-server>
da_minch@my-deja.com writes ..
>In article <MPG.1224aa09fc396e76989c3f@news-server>,
> elephant@squirrelgroup.com (elephant) wrote:
>> oic .. that's where you map an EventID to an Event string .. you must
>> have to provide an entry point for the eventvwr.exe to call into .. I
>> wonder how to do THAT in Perl - don't you love new projects *8^)
>
>what vers of perl and nt are you running? for even if i cut and paste
>your code i continue to get "system cannot find the file specified."
>(i don't want to have to use eventvwr but it would be rather pleasing
>to see my remarks with it...) (by the way your help thus far is
>appreciated)
I've now installed the latest Perl (build 519) from ActiveState .. it
comes with a slightly updated EventLog.pm (although there's been no
updates to the Report function) - and more importantly - DOCUMENTATION
.. although *8^) this is so funny - the documentation for
EventLog::Report is wrong
that having been said .. when I was testing this code I was using build
508 from ActiveState .. ie. certainly not the latest .. the EventLog
version that I was using was the latest one at the time (but that was
pre-build 519 which did contain a new version)
so .. anyway .. the upshot of all this is that I've joined the Perl-
Win32-Porters list and have ammended my copy (so far *B^) of EventLog.pm
so that its behaviour matches the documentation .. I'm sending you my
adjusted version in email .. the only thing that was changed from the
0.61 that came with build 519 was the Report function .. mainly to (a)
stop expecting an object reference and (b) to clean up some of the hash
values that were still referencing from the instance hash
basically this one works as it says it does in the documentation (you
can - obviously - read this with perldoc Win32::EventLog - I didn't
change that documentation)
--
jason - elephant@squirrelgroup.com -
------------------------------
Date: Thu, 19 Aug 1999 15:42:44 -0700
From: Makarand Kulkarni <makkulka@cisco.com>
Subject: Re: directory reading
Message-Id: <37BC8863.96CE4A05@cisco.com>
[ Heather Wiley wrote:
> can I do this in one step?
Yes. Make it a side effect of using map.
map { $hash {$directory. $_} = -s $_ }grep(!/^\./,readdir(ZIPDIR));
--Makarand
------------------------------
Date: Thu, 19 Aug 1999 23:29:54 GMT
From: snowhare@long-lake.nihongo.org (Benjamin Franz)
Subject: Re: GDBM Access in Perl
Message-Id: <Sr0v3.254$EN3.28988@typhoon01.swbell.net>
In article <37BC5DDB.EDDE6B87@netins.net>,
Jim Turner <support@netins.net> wrote:
>I am new to database management in Perl and I'm having one
>hell of a problem accessing a existing database.
[...]
>My perl eqivalent has been:
>
> $map = tie( $file, 'GDBM_File', 0644 )
> or die "\nDamn: $!\n";
>
>Which nets me this error:
[...]
$map = tie %my_hash,'GDBM_File',$file, &GDBM_WRCREAT,0644;
>I fully admit I may just be doing the tie() wrong, but I can't verify as
>there is zero documentation (from what I can find) on GDBM access in Perl.
'perldoc GDBM_File'
--
Benjamin Franz
------------------------------
Date: Fri, 20 Aug 1999 01:48:03 +0200
From: Veronica Karlsson <acinorev@earthling.net>
Subject: Re: HARASSMENT -- Monthly Autoemail
Message-Id: <37BC97B3.2CF3@earthling.net>
Tom Christiansen wrote:
> If someone asks me to stop mentioning to them every month or three that
> their postings have been mangled and maybe they should check into it, then
> I put an entry in the database so they don't get sent that reminder again.
>
BULLSHIT!
http://www.deja.com/getdoc.xp?AN=506936944&fmt=text
What is that post if not a request that you *not* send me another one of
those "nags"?!
Lets see what happened:
http://www.deja.com/getdoc.xp?AN=507220593&fmt=text
I.e. the *first* thing you did was to send me a second one!
It is also interesting to note that in *both* cases you broke your own
"rules". In the nag about my sig being more than four lines high you
used a sig that was five lines high. In the nag that I quoted too much
text you quoted my entire post.
--
:) Irebavpn Xneyffba \ /_ _ _ _ . _ _ Zl bgure fvt vf n Cbefpur
( r93-ixa@fz.yhgu.fr \/(-| (_)| )|(_(_| uggc://jjj.yhqq.yhgu.fr/~ix/ )
If you have a question about html, read the FAQ before asking it to the
group: http://www.htmlhelp.com/faq/wdgfaq.htm (No? Read it anyway!)
------------------------------
Date: Thu, 19 Aug 1999 21:48:55 GMT
From: usenet@admin.u.nu (Miguel Cruz)
Subject: Re: HARASSMENT -- Monthly Autoemail; Spammer Defiant
Message-Id: <bZ_u3.10333$Pw1.140652@news4.giganews.com>
Uriel Wittenberg <urielw@tiac.net> wrote:
> On noticing this post this morning, I emailed you a fairly unmistakable
> request.
Care to share it with us?
miguel
------------------------------
Date: Fri, 20 Aug 1999 09:11:54 +1000
From: elephant@squirrelgroup.com (elephant)
Subject: Re: How can I connect to NT machine's registry remotely when using Win32::TieRegistry
Message-Id: <MPG.12273a4469178106989c5f@news-server>
Percy Tam writes ..
>Does anyone know what's wrong of the following code fragment:
>
>use Win32::TieRegistry;
>
>$RmtKey=Registry->Connect("testpdc", "LMachine, {Delimiter=>"\"});
^^
something missing in there .. check the documentation for what's missing
- type the following at a command prompt
perldoc Win32::TieRegistry
--
jason - elephant@squirrelgroup.com -
------------------------------
Date: Thu, 19 Aug 1999 17:31:31 -0400
From: Stan Towianski <stowians@ford.com>
Subject: How Test If Function Exists?
Message-Id: <37BC77B3.4C15FB9B@ford.com>
Hi,
I want to be able to say if ( some_function exists )
{
some_function();
}
How can I test for the 'existence' of a function?
Can I do something like if ( \some_function ) ?
How can I do this for a variable also?
I don't want to just say if $myvar
which is close, but really only tells me if it is true or false.
Thanks.
------------------------------
Date: 19 Aug 1999 16:25:02 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: How Test If Function Exists?
Message-Id: <37bc843e@cs.colorado.edu>
[courtesy cc of this posting mailed to cited author]
In comp.lang.perl.misc,
Stan Towianski <stowians@ford.com> writes:
:I want to be able to say if ( some_function exists )
: {
: some_function();
: }
:
:How can I test for the 'existence' of a function?
:Can I do something like if ( \some_function ) ?
if (defined &func) {
func();
} else {
# ......
}
:How can I do this for a variable also?
:I don't want to just say if $myvar
:which is close, but really only tells me if it is true or false.
if (defined $myvar) {
# ....
}
Note that you can only do this with scalars and functions.
For arrays and hashes, you have to use:
if (%hash) {
# ....
}
or
if (@array) {
# ....
}
--tom
--
As soon as you pull out the pin, Mister Hand Grenade stops being your friend.
------------------------------
Date: 19 Aug 1999 18:44:19 -0400
From: elflord@panix.com (Donovan Rebbechi)
Subject: Re: Packages and parent packages
Message-Id: <slrn7rp262.cma.elflord@panix3.panix.com>
On Thu, 19 Aug 1999 08:42:13 -0700, Tom Phoenix wrote:
>On 19 Aug 1999, Donovan Rebbechi wrote:
>You seem to think that there's some relationship between
>Grandmother::Mother::Daughter and Grandmother::Mother. Actually, although
>they may look similar, there's nothing connecting them.
Oh, I see. That's the source of my confusion, I guess.
>Import them with the standard mechanism: use foo;
I'll give it a shot.
Thanks.
--
Donovan
------------------------------
Date: Thu, 19 Aug 1999 17:48:49 -0500
From: scottle@stribmail.com (Scott Erickson)
Subject: Parse ANSI X12N 837 claim files
Message-Id: <scottle-1908991748490001@ddsl1-17.ddsl.mr.net>
I am having difficulty figuring out how to correctly parse an ANSI X12N
837 file. Basically, I want to verify that a received 837 has the correct
"syntax" and to be able to extract certain data elements from the file.
With the numerous loops and repeated segments, I have having a hard time
figuring out how to have my program know where it is in a particular file.
Any help is appreciated.
Scott.
------------------------------
Date: Thu, 19 Aug 1999 16:28:28 -0700
From: Makarand Kulkarni <makkulka@cisco.com>
Subject: Re: Parse ANSI X12N 837 claim files
Message-Id: <37BC931C.A12E2D47@cisco.com>
[ Scott Erickson wrote:
> I am having difficulty figuring out how to correctly parse an ANSI X12N
> 837 file. Basically, I want to verify that a received 837 has the correct
> "syntax" and to be able to extract certain data elements from the file.
It will be hard to get help on this topic unless people know what this file
is all about. I did a search on the net and came up with the following --
ANSI X12N 837 is a Health Care claims transaction processing standard for
EDI applications. This is a 767 page document at --
http://www.wpc-edi.com/common/download.dll/hipaa/x098FINAL.pdf
The site does not allow you to access this doc unless you register yourself.
The download is free. The CD ROM is not.
Hope this info helps.
--Makarand
------------------------------
Date: Thu, 19 Aug 1999 18:52:27 -0500
From: scottle@stribmail.com (Scott Erickson)
Subject: Re: Parse ANSI X12N 837 claim files
Message-Id: <scottle-1908991852270001@ddsl1-17.ddsl.mr.net>
In article <37BC931C.A12E2D47@cisco.com>, Makarand Kulkarni
<makkulka@cisco.com> wrote:
> [ Scott Erickson wrote:
>
> > I am having difficulty figuring out how to correctly parse an ANSI X12N
> > 837 file. Basically, I want to verify that a received 837 has the correct
> > "syntax" and to be able to extract certain data elements from the file.
>
> It will be hard to get help on this topic unless people know what this file
> is all about. I did a search on the net and came up with the following --
> ANSI X12N 837 is a Health Care claims transaction processing standard for
> EDI applications. This is a 767 page document at --
> http://www.wpc-edi.com/common/download.dll/hipaa/x098FINAL.pdf
> The site does not allow you to access this doc unless you register yourself.
> The download is free. The CD ROM is not.
> Hope this info helps.
>
> --Makarand
I am working on the assumption that anyone who can help will know what it
is. I am hoping that anyone that does not know what an 837 is will read
the subject line for this posting and then ignore the posting.
I have downloaded the pdf files that describe the 837 v4010, but that has
proven to be of little help for me since I need to know how to handle all
the complex looping structures and repeated segments. The company I work
for uses a vendor product that translates the 837 to various other
formats, so I know that someone has figured out how to parse an 837. I am
hoping such a person is also familiar with Perl.
Scott.
------------------------------
Date: 19 Aug 1999 17:09:15 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Perl Exam Beta Testers Required
Message-Id: <x7wvurv5ok.fsf@home.sysarch.com>
>>>>> "SC" == Stephen Collins <scollins@co-active.com> writes:
SC> Would anyone like to beta test the Perl exam in a shortly-to-be-released
SC> online technical screening system?
i already have my worthless certificate from your competitor. why don't
you just mail me one and not waste my time with the test?
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
uri@sysarch.com --------------------------- Perl, Internet, UNIX Consulting
Have Perl, Will Travel ----------------------------- http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com
"F**king Windows 98", said the general in South Park before shooting Bill.
------------------------------
Date: Thu, 19 Aug 1999 21:27:48 GMT
From: marcel.grunauer@lovely.net (Marcel Grunauer)
Subject: Re: Perl Exam Beta Testers Required
Message-Id: <37c384e6.21898928@news>
On Thu, 19 Aug 1999 16:35:55 -0400, "Stephen Collins"
<scollins@co-active.com> wrote:
> Would anyone like to beta test the Perl exam in a shortly-to-be-released
> online technical screening system?
One more candidate for CCCC (Crusade to Collect Crap Certificates).
------------------------------
Date: Thu, 19 Aug 1999 17:05:53 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: perl system()
Message-Id: <37BC9BE1.C225EA2D@mail.cor.epa.gov>
stefan wrote:
>
> Hello,
>
> I have a small Perl-script which I need to run with nohup like :
>
> nohup script.pl &
>
> After this command the process is started, but it doesn't do anything,
> nothing is written in the nohup.out either.
This might be a buffering problem. Perhaps setting
$|++;
might help. Or it might be the way Slowlaris handles the
calls to shells when the main program has been nohup'ed.
But...
[snip]
> PS: For the sake of argument here is the script:
>
> #!/usr/local/bin/perl
> $ii=0;
> while($ii < 100)
> {
> system("sleep 3");
^^^^^^^^^^^^^^^^^^
hmmmm.
> $ii++;
> print("I'm alive $ii \n");
> }
There's really no reason I can think of to use the system()
statement above when Perl has a sleep() function you can
use instead, which should dodge the whole problem [for now].
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Fri, 20 Aug 1999 09:13:15 +1000
From: elephant@squirrelgroup.com (elephant)
Subject: Re: Q:Two perl programs printing to one txt file
Message-Id: <MPG.12273a987addf9a2989c60@news-server>
Larry Rosler writes ..
>In article <xkfvhabh8tt.fsf@valdemar.col.hp.com> on 19 Aug 1999 13:25:02
>-0600, Eric The Read <emschwar@rmi.net> says...
>> elephant@squirrelgroup.com (elephant) writes:
>> > my experiments are in Win32 .. could it be possible that you need to
>> > seek on other OSs ?
>>
>> My experiments on HP-UX have the same result-- ISTR the other Larry
>> showed that libc in general has this property? I can't find my K & R
>> (2nd ed) to check.
>
>You recall correctly. K&R has nothing to do with it really, as it is a
>library issue, not a language issue.
>
>From the ANSI/ISO C Standard:
>
>Opening a file with append mode ... causes all subsequent writes to the
>file to be forced to the then current end-of-file, regardless of
>intervening calls to the fseek function. In some implementations,
>opening a binary file with append mode ... may initially position the
>file position indicator for the stream beyond the last data written,
>because of null character padding.
excellent .. sounds pretty definitive - maybe a doco patch is in order -
because that flock() example is certainly misleading
--
jason - elephant@squirrelgroup.com -
------------------------------
Date: 19 Aug 1999 17:31:25 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Request for Comments: www.perl.com
Message-Id: <37bc93cd@cs.colorado.edu>
I would like to solicit from you answers to the following questions:
What you like at www.perl.com
What you don't like at www.perl.com
What you would like to see at www.perl.com
What you might like to help with at www.perl.com
Please feel perfectly free to answer as many or as few as you'd like.
Private correspondence is fine if you'd be more comfortable that way,
but it's not specifically requested.
--tom
--
double value; /* or your money back! */
short changed; /* so triple your money back! */
--Larry Wall in cons.c from the 4.0 perl source code
------------------------------
Date: Thu, 19 Aug 1999 17:02:40 -0700
From: "Rusty Williamson" <rwilliamson@uno.gers.com>
Subject: Simple, dumb newbe question... how do I...
Message-Id: <SV0v3.30$0j5.2708@news.connectnet.com>
Hi!
I can't find or figure out how to do this. Can anyone help?
The command I need is:
my $MYPARAMETER=`fetchParameter(MYPARAMETER)`;
But fetchParameter.pl can live wherever the software might be installed so…
my $installDirectory=getInstallDir();
# then maybe...
my $command=$installDirectory . "/bin/fetchParameter(MYPARAMETER)";
But now how do I run it?
my $MYPARAMETER=`$command`;
This does not work. Using eval sounds right but referencing eval doesn't
show me and…
my $MYPARAMETER=eval"`$command`";
...doesn't work. :-(
Thanks!
Rusty Williamson
------------------------------
Date: 19 Aug 1999 21:32:11 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: statistical sorts
Message-Id: <7pht4r$17q@dfw-ixnews16.ix.netcom.com>
Marc Grober (marc@interak.com) wrote:
: In any event, if the full population was large enougha random sample would be fine,
: but for 2 artifacts 1) a random sampling can't serve to place the entire population in
: one of the subgroups and 2) the populations I am dealing with is just several
: thousand.
If you understand you right, you're trying to squeeze blood from a
turnip. You've got a population of N cases with a distribution
characterized by parameters P1,...,Pk; for argument's sake let's assume
it's a normal distribution, which can be completely characterized by two
parameters: P1=mu=the mean and P2=S=the variance. You want to partition
your N cases into K distinct subsets such that each subset's mean and
variance are *identical* to the mean and variance of the population.
The problem is that there is no guarantee that you can find *any* proper
subset of your population that has the same parameters as the population
as a whole. Population parameters aren't fractally symmetric. Consider
the extreme case of a population of two; unless both elements are equal,
the only possible proper subsets are *guaranteed* not to have means equal
to the population mean.
Either you're not explaining your requirements clearly, or you're asking
for the impossible.
------------------------------
Date: Thu, 19 Aug 1999 22:19:30 GMT
From: jay_ethridge@my-deja.com
Subject: Re: system or exec??? Many defunct processes...
Message-Id: <7phvt6$k06$1@nnrp1.deja.com>
One stinking line of code did the trick...
$SIG{CHLD} = 'IGNORE';
Thanks for putting me on the right track, Tom.
Jay
In article
<Pine.GSO.4.10.9908191104340.17303-100000@user2.teleport.com>,
Tom Phoenix <rootbeer@redcat.com> wrote:
> On Thu, 19 Aug 1999, jethridge wrote:
>
> > My problem is whenever I fork all of these processes, I end
> > up with a bunch of zombie processes that will not go away
> > until the parent process is killed off.
>
> Have you seen the FAQ?
>
> perlfaq8.pod:=head2 How do I avoid zombies on a Unix system?
>
> --
> Tom Phoenix Perl Training and Hacking Esperanto
> Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
>
>
--
Jay Ethridge spam_proof email ==> jle123 AT
mindspring DOT com
For the Spammers:
root@localhost
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Thu, 19 Aug 1999 15:24:11 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Testing if a module is installed
Message-Id: <Pine.GSO.4.10.9908191514070.17303-100000@user2.teleport.com>
On Thu, 19 Aug 1999, toby wrote:
> True. The curmudgeons here are afraid they may have to support it and
> they are too busy to bother with questions about a module that
> consider non-standard.
All too common. But they could make a directory called
/usr/local/lib/unsup/ and install there, optionally adding that to the
default @INC path (or not). Using the CPAN module, it's amazingly trivial
to keep this up-to-date as modules are added to CPAN. In fact, it can even
be automated under cron.
> I guess that loading the module to see if the module is loadable
> serves a purpose, but that is nit-picking.
If the module is badly written or mis-installed, it could crash - even if
you use eval. But now I'm doing the nit-picking.
> I guess this check would pass as OK, because it could do no harm,
> could it?
Well, it _should_ do no harm. But loading a module can potentially do
whatever the author wrote in there - which may, indeed, cause harm. And if
you're testing many modules, you're using up a bunch of memory.
Alas, there's no way to tell whether a module is correctly installed
except loading and running it with a regression test. Which is why I'd
just punt: If it's there, assume it's correctly installed. If it's not,
they'll find out when they try to use it, and that's soon enough.
Good luck with it!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 19 Aug 1999 21:12:56 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: Wacky Programming Tales
Message-Id: <7phs0o$17q@dfw-ixnews16.ix.netcom.com>
Mark W. Schumann (catfood@apk.net) wrote:
: I've seen
:
: #define ARBEGIN {
: #define AREND }
:
: in Clipper (a somewhat C-ish language in this regard) code.
:
: Eh?
In Clipper, curly braces are used as anonymous array constructors, so
those mnemonics are presumably short for "array begin" and "array end."
------------------------------
Date: 19 Aug 1999 22:59:14 GMT
From: sholden@staff.cs.usyd.edu.au (Sam Holden)
Subject: Re: what does eq do on lists?
Message-Id: <slrn7rp334.gg8.sholden@staff.cs.usyd.edu.au>
On Thu, 19 Aug 1999 19:50:57 GMT, Bart Lateur <bart.lateur@skynet.be> wrote:
>Sam Holden wrote:
>
>>@ar = (1,2,3,4);
>>@ar[1,2] = (10,20);
>>
>>Changes the values in @ar. How can I modify a list?
>
>$x = 'a'; $y = 'b';
>($x,$y) = (10,20);
>
>Apparently, in more than one way.
>
>Think of the left side as an enumeration of destinations for the
>assignment.
Makes sense now. You can't add, remove, or move elements in the list, but you
can do whatever you normally could do to those elements. So if they are
variables you can assign to them, if they are constants like 1, you can't.
Cool.
--
Sam
Every human culture has good and bad points. Every computer program has
Eveone more bug. Even Perl.
--Larry Wall
------------------------------
Date: 19 Aug 1999 23:00:36 GMT
From: sholden@staff.cs.usyd.edu.au (Sam Holden)
Subject: Re: what does eq do on lists?
Message-Id: <slrn7rp35l.gg8.sholden@staff.cs.usyd.edu.au>
On Thu, 19 Aug 1999 06:09:08 -0700, Larry Rosler <lr@hpl.hp.com> wrote:
>In article <slrn7rnrjk.2an.sholden@pgrad.cs.usyd.edu.au> on 19 Aug 1999
>11:45:23 GMT, Sam Holden <sholden@pgrad.cs.usyd.edu.au> says...
>> On Wed, 18 Aug 1999 11:41:18 +0200,
>> Philip 'Yes, that's my address' Newton <nospam.newton@gmx.net> wrote:
>> >$; might be a value to start with, since \034 is unlikely to occur in
>> >data.
>>
>> Unlikely doesn't really cut it, if it is does use '\0', but I'm sure someone has
>> suggested that already...
>
>Yes, William Herrera suggested using that *two-character* string.
<snip>
>
>I'm sure you meant "\0" to begin with, and we are having fun hair-
>splitting. It wouldn't be the first time! :-)
I'm going to have to completely give up on C... since it has warped my
fragile little mind...
--
Sam
It has been discovered that C++ provides a remarkable facility for
concealing the trival details of a program--such as where its bugs are.
--David Keppel
------------------------------
Date: Thu, 19 Aug 1999 22:31:53 GMT
From: Darrin Edwards <d-edwards@uchicago.edu>
Subject: Re: Why would this autovivify - answers? opinions?
Message-Id: <tgogg3xuzq.fsf@noise.bsd.uchicago.edu>
"William" <bivey@teamdev.com> writes:
> Executing this line
>
> $g_CurHashRef = \%{$g_DescHash{$Label}};
>
> produces the effect in %g_DescHash seen below:
[snip listing with mystery key having been slipped into hash]
From perlref:
6. References of the appropriate type can spring into
existence if you dereference them in a context that
assumes they exist.
So if $Label isn't a key in the hash, the request for a hashref
as the value of $g_DescHash{$Label} causes such autovivification.
> Doing this:
> %CurHash = %{$g_DescHash{$Label}};
> works fine (I'd say, "as expected" but at this point
> my expectations are pretty low). I can live with the
> change, but I'd like to know what's wrong.-Wm
Here you're not asking for a _reference_, but for an actual hash;
hence no autovivification. It should give a warning with -w though:
~>perl -we 'my $Homer = {kids => {bart => "ay caramba", lisa => "daad"},
wife => {marge => "mmrmm"}}; my $Label = "boss";
my %hellions = %{$Homer->{$Label}};
foreach $hashref (values %{$Homer}) {
print keys %{$hashref}, "\n", values %{$hashref}, "\n\n";}'
Use of uninitialized value at -e line 1.
marge
mmrmm
lisabart
daaday caramba
When I try something similar to your first example I get no such warning.
(Perl doesn't complain that the referred-to hash is uninitialized as long
as I only play with references to it.)
perldoc -f exists... if you don't want autovivification, test the
key for validity first.
Darrin
------------------------------
Date: Thu, 19 Aug 1999 15:32:32 -0700
From: Makarand Kulkarni <makkulka@cisco.com>
Subject: Re: Why would this autovivify - answers? opinions?
Message-Id: <37BC8600.B7499FD4@cisco.com>
[ William wrote:
> Executing this line
> $g_CurHashRef = \%{$g_DescHash{$Label}};
> produces the effect in %g_DescHash seen below:
> { results snipped...}
The empty array you see is because of autovivification. Here Perl
sees your first attempt where you are treating $g_DeshHash{$Label}
as a reference to a hash --and it says " a ref to a hash shall it
be.!!". But
there is no key for $Label and it creates this key on the fly and
henceforth
this value will be a hash ref!! You will not be able to do this -
$g_CurHashRef->[0] etc, because Perl can catch this kind of code.
The array message you will get will be something like this --
Not an ARRAY reference at check.pl line ...
--Makarand
------------------------------
Date: Thu, 19 Aug 1999 15:46:14 -0700
From: Michael Nguyen <ez062634@mailbox.ucdavis.edu>
To: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: win32 Net::SMTP
Message-Id: <Pine.GSO.4.10.9908191545480.24619-100000@logan.ucdavis.edu>
Is it possible for both activestate perl and the standard distribution
running on the same system?
On Wed, 11 Aug 1999, David Cassell wrote:
> > Declan wrote:
> >
> > All,
> >
> > I am currently using perl win32 Net::SMTP to send a mail message. Has anyone
> > an example of sending a text message and an attachment.
>
> If you want to attach another file, as opposed to just tacking
> some more text onto the bottom of your message, you'll have to
> use the MIME specification. There's a very nice MIME::Lite
> module available using the ppm program - you are using
> ActiveState Perl, aren't you? - that will help you a lot.
>
> And please, in future, turn off MIME in posts to Usenet.
> The standard is text-only. You may have to dive deeply into
> Microsoft Lookout! Express to find out where the switch is.
>
> David
> --
> David Cassell, OAO cassell@mail.cor.epa.gov
> Senior computing specialist
> mathematical statistician
>
>
-= Michael Nguyen =-
-= Computer Consultant =-
-= Information Technology =-
-= UC Davis, CA 95616 =-
I bet the main reason the police keep people away from a plane crash is they don't want anybody walking in and lying down in the crash stuff, then, when somebody comes up, act like they just woke up and go, "What was THAT?!"
Deep Thoughts - Jack Handey
------------------------------
Date: Thu, 19 Aug 1999 14:24:01 -0700
From: "David Christensen" <dchristensen@california.com>
Subject: Re: Win32::SerialPort tutorial and tpj.com
Message-Id: <37bc7373@news5.newsfeeds.com>
Hello, World!
OK I got in. It looks like you need to be a subscriber to access
articles. I tried signing up, but it puked on my Visa info --
guess I'll need to call them tomorrow (1-888-528-2932 9 a.m. - 5
p.m. Eastern Time).
--
David Christensen
dchristensen@california.com
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 1 Jul 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.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq" from
almanac@ruby.oce.orst.edu. The real FAQ, as it appeared last in the
newsgroup, can be retrieved with the request "send perl-users FAQ" from
almanac@ruby.oce.orst.edu. Due to their sizes, neither the Meta-FAQ nor
the FAQ are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq" from
almanac@ruby.oce.orst.edu.
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 593
*************************************