[8580] in Perl-Users-Digest
Perl-Users Digest, Issue: 2197 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Mar 27 21:07:13 1998
Date: Fri, 27 Mar 98 18:00:28 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Fri, 27 Mar 1998 Volume: 8 Number: 2197
Today's topics:
an extension question (Douglas Harvey)
caller(), $wantarray, and void context ken@forum.swarthmore.edu
Re: caller(), $wantarray, and void context <bholzman@mail.earthlink.net>
Re: caller(), $wantarray, and void context (Ken Williams)
Re: Days of the Week <strepsil@very.net>
Re: debugging Perl tim@maroney.org
Re: do vs eval; configuration files <zenin@archive.rhps.org>
Re: Going Rates for PERL Programming??? <webmaster@fccjmail.fccj.cc.fl.us>
Re: Going Rates for PERL Programming??? <webmaster@fccjmail.fccj.cc.fl.us>
How to determine exe versions in Win95/NT qvanegeren@frxsoft.com
Linux Msqlperl, WDB SQL,,Mini SQL Database Server, SebS <gwaters@dorsai.org>
Re: Macperl (Kevin Reid)
Re: Macperl (Paul J. Schinder)
Re: Nested quantifier in regexp problem <bholzman@mail.earthlink.net>
Re: NNTP: making a nice, threaded index? (Earl Hood)
Re: Perl Libraries y2k compliance <webmaster@fccjmail.fccj.cc.fl.us>
Re: Perl print email problem (Stuart McDow)
Re: Perl versus Python benchmark-results <dheise@metronet.de>
Re: Perl versus Python benchmark-results (Thomas Ackermann)
Re: print crypt($password,$Salt); not working (hymie!)
Re: PROPOSAL: The Perl Dictionary <efinch@vais.net>
Re: proposal: while $line (<FILE>) <webmaster@fccjmail.fccj.cc.fl.us>
Re: proposal: while $line (<FILE>) <webmaster@fccjmail.fccj.cc.fl.us>
Re: Someone put my munged e-mail address on a spam list (John Stanley)
Re: Suppressing "used only once" (Craig Berry)
Using Oracle DATE field with DBI <steves@cnj.digex.net>
Re: verifying email address -- how? (Kai Henningsen)
What does this mean =~ ? <mobrien@rocketmail.com>
Re: What is a JAPH <webmaster@fccjmail.fccj.cc.fl.us>
|| operator in list context <pholser@nortel.com>
Re: || operator in list context <bholzman@mail.earthlink.net>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 28 Mar 1998 01:30:06 GMT
From: doug@mcs.com (Douglas Harvey)
Subject: an extension question
Message-Id: <6fhjqu$8hk$1@Nntp1.mcs.net>
Keywords: perl c extension
I've written a perl extension to an existing set of "C" library
routines that we use at work. It is very useful, but a little
slow. One of the "C" routines returns a pointer to a buffer.
I noticed that the perl internal routines make a copy of this
buffer. This routine is called for each record we process, which
can be millions, tens of gigabytes of data.
I also noticed that the perl internal routines also always put a
NULL at the end of the data buffer associated with (say) a scalar.
Any opinions on the wisdom of simply having the perl scalar point
to the "C" data buffer (possibly without a terminating NULL).
One more thing: I noticed that there is a flag that can be set on
a perl variable to make it read-only. I am not aware of how this
can be done within a perl program and would like to hear of how
anyone has made use of this. For example, in the above situation,
should I make the scalar pointing to the "C" buffer read-only.
Thanks in advance for any feedback.
--
Douglas Harvey
doug@mcs.com
------------------------------
Date: Fri, 27 Mar 1998 16:13:03 -0600
From: ken@forum.swarthmore.edu
Subject: caller(), $wantarray, and void context
Message-Id: <6fh84q$lpb$1@nnrp1.dejanews.com>
Hi,
I noticed something interesting. If I do @list = caller(0), $list[5] is
supposed to tell me whether my function is called in a list or scalar context,
much like the wantarray() function. The interesting part is that $list[5] is
0 in a scalar context, 1 in a list context, and '' in a void context. That
means that caller(0) can be used to tell the difference between a scalar
context and a void context.
My question is, is this behaviour guaranteed in all versions of perl after
some specific version? Or is it just some handy quirk of my version
(5.004_04)?
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Fri, 27 Mar 1998 17:23:30 -0500
From: Benjamin Holzman <bholzman@mail.earthlink.net>
To: ken@forum.swarthmore.edu
Subject: Re: caller(), $wantarray, and void context
Message-Id: <351C26E2.8F2A65AB@mail.earthlink.net>
Well, since the wantarray function does the same thing, I'd imagine you
can rely on it.
ken@forum.swarthmore.edu wrote:
>
> Hi,
>
> I noticed something interesting. If I do @list = caller(0), $list[5] is
> supposed to tell me whether my function is called in a list or scalar context,
> much like the wantarray() function. The interesting part is that $list[5] is
> 0 in a scalar context, 1 in a list context, and '' in a void context. That
> means that caller(0) can be used to tell the difference between a scalar
> context and a void context.
>
> My question is, is this behaviour guaranteed in all versions of perl after
> some specific version? Or is it just some handy quirk of my version
> (5.004_04)?
>
> -----== Posted via Deja News, The Leader in Internet Discussion ==-----
> http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Fri, 27 Mar 1998 17:46:19 -0500
From: ken@forum.swarthmore.edu (Ken Williams)
Subject: Re: caller(), $wantarray, and void context
Message-Id: <ken-2703981746190001@news.swarthmore.edu>
> Date: Fri, 27 Mar 1998 17:23:30 -0500
> From: Benjamin Holzman <bholzman@earthlink.net>
> Organization: Very little
> MIME-Version: 1.0
> Newsgroups: comp.lang.perl.misc
> To: ken@forum.swarthmore.edu
> Subject: Re: caller(), $wantarray, and void context
>
> Well, since the wantarray function does the same thing, I'd imagine you
> can rely on it.
My wantarray function doesn't do the same thing. It doesn't distinguish
between a scalar and void context, as the following test program
demonstrates.
_________________________________________
$var = &context_using_wantarray('arg');
@var = &context_using_wantarray('arg');
&context_using_wantarray('arg');
$var = &context_using_caller('arg');
@var = &context_using_caller('arg');
&context_using_caller('arg');
sub context_using_wantarray {
my $context = wantarray;
print ("wantarray: $context\n");
}
sub context_using_caller {
my $context = (caller(0))[5];
print ("caller: $context\n");
}
_________________________________________
Output:
wantarray:
wantarray: 1
wantarray:
caller: 0
caller: 1
caller:
_________________________________________
------------------------------
Date: Fri, 27 Mar 1998 15:25:09 +1100
From: "Mike Barnes" <strepsil@very.net>
Subject: Re: Days of the Week
Message-Id: <890972711.765394@satin.sensation.net.au>
>Date::DateCalc
>Date::Manip
I should have been more specific. I'd happily use one of the Date modules,
if I could find one for Win32 Perl, build 306. If there has been a port, I'd
like to know where to find it. I've rummaged through CPAN, but haven't
turned up anything so far.
I'm hoping to end up with a script that's portable between Unix and NT, so I
need either a module that exists on both platforms, or just a little hunk of
code to do this one job.
I'll go and slap myself around a bit for posting such a vague message.
Mike.
------------------------------
Date: Fri, 27 Mar 1998 17:31:53 -0600
From: tim@maroney.org
Subject: Re: debugging Perl
Message-Id: <6fhcnu$pqt$1@nnrp1.dejanews.com>
tim@maroney.org <tim@maroney.org> wrote:
> >Be nice if it had a real user interface, though. If I had the free time I'd
> >like to create a CGI/JavaScript front-end to the debugger, which could then
be
> >run locally in loopback mode or remotely for real CGI debugging. The
command
> >line interface it has now is, like, from the stone ages, daddy-o.
In article <slrn6hgkmt.gfi.jgloudon@manitoba.bbn.com>,
jgloudon@bbn.com wrote:
> It does have a "real" user interface, a command line one, and I've seen
> people do some stuff in emacs.... The debugger can do everything you'd want.
> Simple in interface doesn't mean hard to use or underpowered.
Well, yes, command line interfaces are harder to use than GUI ones. The
technical reason is that recognition is an easier cognitive task for humans
than recall, by about an order of magnitude. That's on the command side; on
the presentation side, once you've used a debugger that opens a window onto
your code (with a breakpoint checkbox on each line, and an arrow to show the
current execution point), and an auto-updating variable value window, you'll
never go back -- it's like looking through a picture window instead of an
arrow slit. Debuggers finally started to leap forward with Mike Lockwood's
SourceBug for the Mac and one hopes the conservative programming community
will eventually accept these benefits on other platforms as well. Programmers
traditionally lag behind the general market in accepting new user interface
paradigms.
HTML and JavaScript are still a bit underpowered for a debugger. Still it
should be possible to put out the source lines with variable image tags for
the current line arrow and checkboxes for breakpoints. Variable updating could
be handled in a frame that would need to update for each line, but you
shouldn't need to refresh the source code window itself very often.
>BTW...I'd like
> to see CGI debugging in any language that goes beyond "print Content-type:
...".
Yep. No reason that a CGI-based perl debugger couldn't do exactly that.
printf-style debugging is useful but it has its limitations. In CGIs it's
especially annoying because you're interfering with the output channel.
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: 28 Mar 1998 00:36:03 GMT
From: Zenin <zenin@archive.rhps.org>
Subject: Re: do vs eval; configuration files
Message-Id: <891045772.399065@thrush.omix.com>
Tom Rokicki <rokicki@cello.hpl.hp.com> wrote:
: I've encountered some strange behavior in packages and files, do and
: eval, lexical and package/global variables.
Somewhere in the Blue Camel can be found a statement something
like, "If this seems odd that's ok, be cause it is odd."
>snip<
: There are strange things going on here.
Actually, they are doing exactly what they are meant to do
(mostly), just not what they look like they should do. This is one
of those rare cases that Perl doesn't do what you would think it
would (at first glance), but is still correct. The
misunderstanding is with the differences, rights, and priorities of
lexical and package global variables. The scoping issues of an
eval() are a little mislead as well.
I'll take these one at a time. -The last one really is odd however,
and I can't seem to explain it. The debugger doesn't help either...
Anyone else care to explain the last one?
: The output of my script:
: ::do $::a X my($a) 2 $User::a 3 $User::my(a) 4
Since you're doing a do(), the file "test.pl" is considered it's own
block (and not in the same block as "main.pl"). As such, it has no
access to the my() copy of $a because (being in another block/scope)
it's out of scope. Since do() is called in the main:: package and
"test.pl" doesn't change it's package, any non-qualified variables
(namely, "$a = 1") are package globles of the main:: package.
This is why $main::a is changed, but my($a) is not.
: ::eval $::a 1 my($a) X $User::a 3 $User::my(a) 4
Eval()s are done within the current scope, so you're not in an
outside scope/block the way a do() would be. Because of this, my($a)
is still in scope and "overrides" $main::a if you don't use a qualifier.
Thus, my($a) is changed, and $main::a is not.
Lexical scope is the "visible" scope. Once it's in a string (the
backticks create the string), it's then in the current visible
block. With the do(), it's considered in another file, and
therefor not "visible" and so outside the lexical scope.
: ::do2 $::a 1 my($a) 2 $User::a X $User::my(a) 4
You're now in package User and executing a self-contained block (see
the other do() answer above) inside of that block. Once again, you
have no access to any outside my() vars, but you do have access to
package globals. And since "test.pl" neither declares it's own
package nor fully qualifies it's copy of $a, it's considered a
package global in the current package, namely User::.
: ::eval2 $::a 1 my($a) X $User::a 3 $User::my(a) 4
You're eval()ing a string again. As such you are still in the
lexical scope of main::'s my($a), regardless of any package name
you change to. This is why main::'s my($a) is changed and not that
of User::'s my($a) (which is totally out of scope), or any global of
any package. Lexicals have priority over package globals.
: User::do $::a 1 my($a) 2 $User::a X $User::my(a) 4
Same as your first do(), but just called from another package.
You've got "test.pl" now it's it's own file/block and therefor
scope, but still inside package User::, thus the change of
the package global $User::a because you don't qualify it otherwise.
: User::eval $::a 1 my($a) 2 $User::a 3 $User::my(a) 4
This one I can't explain...it should change User::'s my($a),
but it doesn't...bug? User::'s my($a) should be in scope for
this eval(), but it's not working... :-/
--
-Zenin
zenin@archive.rhps.org
------------------------------
Date: Sat, 28 Mar 1998 01:08:05 GMT
From: Webmaster <webmaster@fccjmail.fccj.cc.fl.us>
Subject: Re: Going Rates for PERL Programming???
Message-Id: <351C4C10.683E2294@fccjmail.fccj.cc.fl.us>
Webmaster wrote:
> An excellent point :-)
Oops! Tom Christiansen's AutoFlame(tm) will get me for that last one...
:-(
Sneex
------------------------------
Date: Sat, 28 Mar 1998 01:06:23 GMT
From: Webmaster <webmaster@fccjmail.fccj.cc.fl.us>
Subject: Re: Going Rates for PERL Programming???
Message-Id: <351C4BA9.AE51BE09@fccjmail.fccj.cc.fl.us>
Zenin wrote:
> By simply answering questions in this group I give possible clients
> an idea of what my development and communication skills where, and
> general personality. Information that can not clearly be gained
> from just reading someone's web page or resume. It's not two hard
> to see differences in peoples skills when one person is giving
> clear answers to questions about building multithreaded database
> proxy servers while another is having a hard time finding the man
> page for the CGI module.
>
> --
> -Zenin
> zenin@archive.rhps.org
An excellent point :-)
------------------------------
Date: Fri, 27 Mar 1998 16:05:26 -0600
From: qvanegeren@frxsoft.com
Subject: How to determine exe versions in Win95/NT
Message-Id: <6fh7mi$lc2$1@nnrp1.dejanews.com>
I have a bunch of executables in a directory and I need to figure out the
Version of all of the executable files. I know that there HAS to be a way to
do this in PERL. Does anybody have any ideas on how I could get this
information from the files? Any help would be greatly appreciated. Thanks in
advance for any suggestions you may have...
Quenten Van Egeren
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Fri, 27 Mar 1998 11:07:51 -0500
From: "Greg Waters" <gwaters@dorsai.org>
Subject: Linux Msqlperl, WDB SQL,,Mini SQL Database Server, SebServer
Message-Id: <6fgj5e$ijt@enews1.newsguy.com>
HI,
Do you know of a book that would help in configuring all these programs to
get them to work together.
Greg
I seem to be lost in the configeration and setup of these programs.
The book I have Internet database servers by Jeffe Rowe is really a hack
job.
------------------------------
Date: Fri, 27 Mar 1998 17:20:49 -0500
From: kpreid@ibm.net (Kevin Reid)
Subject: Re: Macperl
Message-Id: <1d6jnfg.1a6rwxakdmrq0N@slip166-72-108-221.ny.us.ibm.net>
<tchurch@gmu.edu> wrote:
> I am new to Mac developement and have two problems in my first attempt. I
> am trying to make a stand-alone app and have two discrepencies.
>
> 1. The script works fine on my machine, but when I port it I get error
> messages that tell me perl cannot find Macperl::DoApplescript. The
> applescript is to open the select file window when the user double-
> clicks on the app. The drag and drop part works just fine.
Because it's MacPerl::DoAppleScript (note case).
> 2. Whenever the script exits, it leaves an instance of Macperl running
> under the finder(? top left corner list on the Mac). I would like
> the application to shut down completely and not have this instance
> running. Is this possible?
Just call MacPerl::Quit().
--
Kevin Reid. | Macintosh.
"I'm me." | Think different.
------------------------------
Date: Fri, 27 Mar 1998 17:43:03 -0500
From: schinder@leprss.gsfc.nasa.gov (Paul J. Schinder)
Subject: Re: Macperl
Message-Id: <schinder-2703981743030001@schinder.clark.net>
In article <1d6jnfg.1a6rwxakdmrq0N@slip166-72-108-221.ny.us.ibm.net>,
kpreid@ibm.net (Kevin Reid) wrote:
} <tchurch@gmu.edu> wrote:
}
[snip]
} > 2. Whenever the script exits, it leaves an instance of Macperl running
} > under the finder(? top left corner list on the Mac). I would like
} > the application to shut down completely and not have this instance
} > running. Is this possible?
}
} Just call MacPerl::Quit().
Yes, but call MacPerl::Quit with the proper flag, and you can put the call
right at the beginning of your script if you'd like. MacPerl::Quit does
*not* force MacPerl to quit. It merely sets a flag telling it what to do
when it hits a real or implied exit().
}
--
Paul J. Schinder
NASA Goddard Space Flight Center
Code 693, Greenbelt, MD 20771
schinder@leprss.gsfc.nasa.gov
------------------------------
Date: Fri, 27 Mar 1998 17:46:11 -0500
From: Benjamin Holzman <bholzman@mail.earthlink.net>
To: rick@marinweb.com
Subject: Re: Nested quantifier in regexp problem
Message-Id: <351C2C33.DB8178A0@mail.earthlink.net>
> @terms = ($in =~ /(?:(?:")([^"]+)(?:"))|(\S+)/g);
> @terms = grep /$_/, @terms;
You can just do:
@terms = grep(defined,($in =~ /"([^"]+)"|(\S+)/g));
The second line is what was tripping you up. You were using $_ in a
pattern without quoting the metacharacters. There's two ways to do
that; use the metaquote() function, or /\Q$_\E/.
HTH,
Benjamin Holzman
>
> That second line gets rid of the empty array values.
>
> The problem is that the quantifiers + and * are giving me a headache
> (and of course it's a resume processing application, so "C++" is one
> of the first things people will try to search for).
>
> If I add the lines...
>
> $in =~ s/\+/\\\+/g;
> $in =~ s/\*/\\\*/g;
>
> before the regexps above, I can keep the thing from crashing with a
> nested regexp error, but then it doesn't extract the term with, for
> example, ++ in it.
>
> Here is the command line code I'm using to test this:
>
> while (<>) {
> $in = $_;
>
> $in =~ s/\+/\\\+/g;
>
> @terms = ($in =~ /(?:(?:")([^"]+)(?:"))|(\S+)/g);
> @terms = grep /$_/, @terms;
> for (@terms){
> print " $_\n"
> }
> }
>
> It should accept the simulated text input entry and print the terms.
>
> I'm so confused!!! I'll greatly appreciate any help.
>
> Regards,
> Rick Freeman
>
> M a r i n W e b
>
> Marin's Home on the World Wide Web
> http://www.marinweb.com/
>
> 98 Main Street #453
> Tiburon CA 94920
> 415-458-3201
------------------------------
Date: 27 Mar 1998 20:37:50 GMT
From: ehood@medusa.acs.uci.edu (Earl Hood)
Subject: Re: NNTP: making a nice, threaded index?
Message-Id: <6fh2mu$kug@news.service.uci.edu>
In article <35193726.9317277@news.clinet.fi>,
Teemu Hannonen <th@clinet.fi> wrote:
>Are there any modules or scripts designed for a web/news gateway? Or
>how could I create an index of all messages where they are threaded
>according to their follow-up level, not just listed from the oldest to
>the latest one? (This shouldn't (?) be relevant, but I'm using Perl
>v5.004_02 on WinNT and accessing Netscape Collabra server 3.5)
>Thanks,
You can try to look at
<URL:http://www.oac.uci.edu/indiv/ehood/mhonarc.html>. The program is
somewhat old, so perl 4-isms exists. Also, you will have to
deal with application specific aspects of the program. The main
function is compute_threads() in mhthread.pl.
--ewh
--
Earl Hood | University of California: Irvine
ehood@medusa.acs.uci.edu | Electronic Loiterer
http://www.oac.uci.edu/indiv/ehood/ | Dabbler of SGML/WWW/Perl/MIME
------------------------------
Date: Sat, 28 Mar 1998 01:46:48 GMT
From: Webmaster <webmaster@fccjmail.fccj.cc.fl.us>
Subject: Re: Perl Libraries y2k compliance
Message-Id: <351C5523.62D958FA@fccjmail.fccj.cc.fl.us>
lvirden@cas.org wrote:
> Note that I am not referring here to anyone on _this_ newsgroup, but those
> nameless, faceless 'bosses' across the world who expect their staff to each
> go out and check the doggone same code.
>
> It seems infinitely preferable for one pass to be made over the code,
> documenting the places which at least use 2 digit years and, if the
> case IS found where the two digit year is used WITHIN the library itself
> in a manner that will result in incorrect behavior during Jan 2000, make
> sure that fixes occur and are distributed.
I am a firm believer in 'backing up the server and having Y2k today...' and
trying to get it to fail. Much cheaper to know now than then :-)
2 Cents,
Sneex :-)
------------------------------
Date: 27 Mar 1998 22:06:14 GMT
From: smcdow@arlut.utexas.edu (Stuart McDow)
Subject: Re: Perl print email problem
Message-Id: <6fh7sm$gqs$1@ns1.arlut.utexas.edu>
Why is it that everyone wants to use sendmail for mailing when using
Mail::Send, available from the CPAN, provides a much simpler
interface?
Even if one doesn't use Mail::Send, using the machine's local mail
agent (like mailx or Mail) is still far simpler than using sendmail.
--
Stuart McDow Applied Research Laboratories
smcdow@arlut.utexas.edu The University of Texas at Austin
"It is obvious that about 750,000 people ago, Austin was a wonderful City."
------------------------------
Date: 27 Mar 1998 22:05:24 GMT
From: "Dirk Heise" <dheise@metronet.de>
Subject: Re: Perl versus Python benchmark-results
Message-Id: <01bd59c8$e949c8a0$LocalHost@dreadzone>
Thomas Ackermann wrote:
> perl-programmer). Personally this was sponsered by a friend's sentence
> about the apparent outcome: "Python has to grow two or three years to
> be able to beat Perl in regex-issues" - and i was satisfied to see that
> it *can* be faster in at least some cases.
So the Perl programmers will stick to their language
another 2 or 3 years and then stick to Python?
Funny imagination.
Dirk Heise, Braunschweig, Germany
dheise@metronet.de
------------------------------
Date: 28 Mar 1998 01:23:21 GMT
From: tgm@rhein.iam.uni-bonn.de (Thomas Ackermann)
Subject: Re: Perl versus Python benchmark-results
Message-Id: <6fhje9$113a@news.rhrz.uni-bonn.de>
Dirk Heise (dheise@metronet.de) wrote:
: Thomas Ackermann wrote:
: > perl-programmer). Personally this was sponsered by a friend's sentence
: > about the apparent outcome: "Python has to grow two or three years to
: > be able to beat Perl in regex-issues" - and i was satisfied to see that
: > it *can* be faster in at least some cases.
: So the Perl programmers will stick to their language
: another 2 or 3 years and then stick to Python?
Of course! ;-)
Seriously, i think he meant to say "until Python is as good in regex-issues
as Perl is already now." OK?
Btw. Python still seems to be faster than Perl in case of many patterns ...
(In "our" current test-implementation)
Byebye,
--
Thomas Ackermann | <tgm@math.uni-bonn.de> | Tel. 0228/73-7773|631369
LINUX, not Micro$oft! | no unnecessary MIME extended mails!
no unnecessary Graphics in HTML-Document! | GURPS, not T$R!
put your HTML stuff in a ftp-accessible directory!
finger tgm@rhein.iam.uni-bonn.de for public key
------------------------------
Date: 28 Mar 1998 00:09:35 GMT
From: hymie@lactose.smart.net (hymie!)
Subject: Re: print crypt($password,$Salt); not working
Message-Id: <6fhf3v$9k9$1@news.smart.net>
In our last episode, the evil Dr. Lacto had captured our hero,
"Tony Kenny" <tony@cyberscape.net>, who said:
>The line:
>
>print crypt($Password,$Salt);
>
>works on one machine and returns nothing on another.
Did you flush your output?
..hymie! http://www.smart.net/~hymowitz hymie@lactose.smart.net
My wife said "I just want to see / What you're downloading to our PC."
Then she made me delete / All my files complete / of Pamela Anderson Lee.
--Nadine Martens, in PC Magazine
------------------------------
Date: Fri, 27 Mar 1998 16:44:23 -0500
From: Ed Finch <efinch@vais.net>
Subject: Re: PROPOSAL: The Perl Dictionary
Message-Id: <351C1DB7.C8437289@vais.net>
> In article <x7btusk7tq.fsf@sysarch.com>, Uri Guttman <uri@sysarch.com> posted:
>
> >i have been collecting the perl definitions we have posted. would anyone
> >like to see them on perl.com and/or perl.org under the humor categories?
> >
I would - that was the intent of my initial proposal.
Ed
------------------------------
Date: Sat, 28 Mar 1998 01:19:23 GMT
From: Webmaster <webmaster@fccjmail.fccj.cc.fl.us>
Subject: Re: proposal: while $line (<FILE>)
Message-Id: <351C4EB5.FC91A0A8@fccjmail.fccj.cc.fl.us>
Mike Stok wrote:
> perl gives you enough rope to hang yourself. There are plenty of other
> languages which keep the rope safely locked away...
>
> Mike
I never dreamed I would see that comment made about Perl!
I listened to people say it for years while programming C, but Perl?
I have found Perl a better 'mentor' than most other langauges, and definitely not
a hangman......
2 cents,
Sneex :-)
------------------------------
Date: Sat, 28 Mar 1998 01:22:50 GMT
From: Webmaster <webmaster@fccjmail.fccj.cc.fl.us>
Subject: Re: proposal: while $line (<FILE>)
Message-Id: <351C4F85.EC6C715A@fccjmail.fccj.cc.fl.us>
Dan Boorstein wrote:
> my suggestion was to make:
>
> while $line (<FILE>)
>
> perform similarly, in that $_ would be replaced by $line, but still
> maintain the magic 'defined' test for <FILE>.
I vote for this as well; primarily because I have found $_ getting
destroyed during some operations and I have to make other $variables for
intermediate steps...
Sneex :-)
------------------------------
Date: 27 Mar 1998 23:31:57 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: Someone put my munged e-mail address on a spam list
Message-Id: <6fhctd$fgc$1@news.orst.edu>
In article <6fg0fd$koc$1@csnews.cs.colorado.edu>,
Tom Christiansen <tchrist@mox.perl.com> wrote:
>Usenet is a public forum.
USENET is not mail.
>Cope. I hate having to go out of the way to
>send the private response that netiquette suggests.
Then don't do it. Netiquette does not suggest that there must be a
private response, just that some things are better there. "Things go
better with Coke" doesn't mean you have to drink Coke. Spicey brown
mustard going well with corned beef does not mean you must eat corned
beef.
>Fighting spam by address munging is like fighting speeding by not going
>out of your house even to visit your friends.
This is a poor analogy. Your speeding does not do me any harm. It does
not get in the way of me using the road. It costs me nothing when you
speed, thus I save nothing wrt your speeding by staying at home. Any
valid analogy must include some cost being paid by the traveller that
has nothing to do with the travel -- that is what spam is. It is
unrelated to the use of USENET.
>It doesn't do anything
>about the problem, and is a selfish pain in the butt.
Address munging avoids the costs incurred by spam, and it causes the
spammers to waste time sending mail to invalid addresses. Time is one of
those zero sum things; if a spammer uses some of it to send email to an
invalid address, he isn't using it to send email to a valid address.
>I support fighting spam in these ways, in order of preference:
>
> 1) Legal measures (likewise for junk snailmail and junk phone calls)
We cannot all afford to hire attorneys to sue people for spamming.
Notice also that suing someone for having done it means that it has
already happened. It is better, IMNSHO, to not have the damage occur
than to sue to recover.
> 2) ISP IP-filters and addr-blocking via sendmail 8.9, for example
We do not all do business through ISP's. And as I recall, our last
private discussion arose over the fact that I "addr-block" here and you
complained to my postmaster about it.
> 3) Personal filters
For many people, by the time "personal filters" can process the spam,
the cost has already been incurred. Personal filters do not always
benefit the user.
>Whether, when, and why I reveal that table or its Perl code to others
>is a different matter. Currently, I favor doing so, and rude arguments
>to the contrary will only hasten its publication. :-)
------------------------------
Date: 27 Mar 1998 21:56:51 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Suppressing "used only once"
Message-Id: <6fh7b3$q39$1@marina.cinenet.net>
Hal Snyder (hal@vailsys.com) wrote:
: We have a lot of legacy code requiring files that just define variables.
:
: oldstuff.pl:
: $oldFoo = "gnarf";
: $theAnswer = 42;
: proggy.pl:
: require ".../oldstuff.pl";
:
: Just one small step forward for some persons would be the use of "-w",
: but they are immediately punished by gobs of "used only once" warnings
: about variables in the required file that are not used in the main
: program.
:
: I tried permutations of $^W and __WARN__ in the main program but was
: unable to suppress "used only once" warnings for oldFoo, etc.
:
: The [ugly] workaround we're using now is to insert after the require,
:
: (($oldFoo, ... other unused variables in oldstuff ...)) if (0);
:
: Is there a better way to do this?
Well, if you know all the useless variable names in oldstuff.pl (as seems
to be the case, given your list workaround above), why not just delete
them from oldstuff.pl?
---------------------------------------------------------------------
| Craig Berry - cberry@cinenet.net
--*-- Home Page: http://www.cinenet.net/users/cberry/home.html
| Member of The HTML Writers Guild: http://www.hwg.org/
"Every man and every woman is a star."
------------------------------
Date: Fri, 27 Mar 1998 17:06:04 -0500
From: Stephen Shindle <steves@cnj.digex.net>
Subject: Using Oracle DATE field with DBI
Message-Id: <351C22CB.5DC3D34D@cnj.digex.net>
I'm having problems retrieving/inserting data in Oracle DATE format
using DBI 0.93 and
DBD-Oracle 0.47. I'm trying to bind SQL parameters but using the
SQL_DATE type doesn't seem
to work.
Here's an example:
$sth->bind_param(":$col_n", $self->{data}{$col_n}, {TYPE =>
SQL_DATE});
This code still binds the variable as a string.
Do I have to wait for the next version of DBD-Oracle for DATE field
support?
------------------------------
Date: 28 Mar 1998 01:06:00 +0200
From: kaih=6qkBAZb1w-B@khms.westfalen.de (Kai Henningsen)
Subject: Re: verifying email address -- how?
Message-Id: <6qkBAZb1w-B@khms.westfalen.de>
jdporter@min.net (John Porter) wrote on 26.03.98 in <351A690E.7AF9@min.net>:
> > - could the address provided be valid? by this, i mean - is this a
> > syntactically valid address?
>
> Impossible.
Quite possible.
(Oh, and btw: at the very least, you need to look at RFC 1123, not only at
RFC 822. You probably also want to look at the DNS RFCs, look at rfc-
index.txt to find them and anything else that might be related.)
Of course, that's hard work (see the FAQ, there's example code).
The FAQ claims there are deliverable, but syntactically invalid addresses;
I've never seen any, if you don't count special local forms that only work
on the same host, and I don't remember this coming up in the working group
currently drafting a successor to RFC 822 (see
draft-ietf-drums-msg-fmt-*.txt in the usual places), so unless someone has
some actual examples, I'm going to call that a myth.
Kai
--
Internet: kai@khms.westfalen.de
Bang: major_backbone!khms.westfalen.de!kai
http://www.westfalen.de/private/khms/
------------------------------
Date: Fri, 27 Mar 1998 21:07:52 -0400
From: "Billy" <mobrien@rocketmail.com>
Subject: What does this mean =~ ?
Message-Id: <6fhi6q$jms@atlas.cs.upei.ca>
Does it mean match?
Explain?
Newbie
------------------------------
Date: Sat, 28 Mar 1998 01:31:53 GMT
From: Webmaster <webmaster@fccjmail.fccj.cc.fl.us>
Subject: Re: What is a JAPH
Message-Id: <351C51A2.E6C506AE@fccjmail.fccj.cc.fl.us>
Randal Schwartz wrote:
> Those who know, don't tell.
>
> Those who tell, don't know.
>
> :-)
>
> print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
> ## legal fund: $20,990.69 collected, $186,159.85 spent; just 157 more days
> ## before I go to *prison* for 90 days; email fund@stonehenge.com for details
>
> --
> Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
> Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
> Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
> Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
> Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
I'm telling - so I guess I don't know...
But see my version in action at
http://webmaster.fccj.org/cgi/JAPH.cgi
(I mangled something Mr. Schwartz wrote; to give credit where it's due...)
I posted here this past week, so it should show up in a DejaNews search...
------------------------------
Date: Fri, 27 Mar 1998 16:16:13 -0600
From: Paul Holser <pholser@nortel.com>
Subject: || operator in list context
Message-Id: <351C252D.1492@nortel.com>
Perl 5.004_04, built on HP-UX 10.20:
$ perl -e '@a = @ARGV || keys %ENV; print "@a\n"' a b c
3
$ perl -e '@a = @ARGV ? @ARGV : keys %ENV; print "@a\n"' a b c
a b c
I'm a little confused about the results of the
first invocation. I understand that @ARGV is
probably getting demoted to scalar context
to determine the truth of the || expression;
but if @ARGV evaluates to true, the value of
the || expression is a one-element list consisting
of the demotion, rather than the @ARGV list,
which I would expect.
I see that || returns the last value evaluated...
but getting back ( 3 ) is not really what I meant.
Is this just the way Perl works, or have I tripped
over a bug?
TIA,
pholser
--
// Paul Holser ~ Northern Telecom, Inc. ~ pholser@nortel.com
// Wireless Automation Tool Development
// $time ||= time; $time = time unless $time; # is cap-tuuured!...
// "A good craftsman never blames his tools." --Keith Olbermann
------------------------------
Date: Fri, 27 Mar 1998 17:22:14 -0500
From: Benjamin Holzman <bholzman@mail.earthlink.net>
To: Paul Holser <pholser@nortel.com>
Subject: Re: || operator in list context
Message-Id: <351C2696.44AE9BEE@mail.earthlink.net>
Paul Holser wrote:
>
> Perl 5.004_04, built on HP-UX 10.20:
>
> $ perl -e '@a = @ARGV || keys %ENV; print "@a\n"' a b c
> 3
> $ perl -e '@a = @ARGV ? @ARGV : keys %ENV; print "@a\n"' a b c
> a b c
>
> I'm a little confused about the results of the
> first invocation. I understand that @ARGV is
> probably getting demoted to scalar context
> to determine the truth of the || expression;
> but if @ARGV evaluates to true, the value of
> the || expression is a one-element list consisting
> of the demotion, rather than the @ARGV list,
> which I would expect.
>
> I see that || returns the last value evaluated...
> but getting back ( 3 ) is not really what I meant.
> Is this just the way Perl works, or have I tripped
> over a bug?
It's just the way Perl works (. @ARGV evaluated in scalar context
yields the number of scalars in it. If you think about it, you wouldn't
want an expression to be evaluated more than once (once in scalar, once
in list), because that might cause unwanted side effects.
>
> TIA,
> pholser
> --
> // Paul Holser ~ Northern Telecom, Inc. ~ pholser@nortel.com
> // Wireless Automation Tool Development
> // $time ||= time; $time = time unless $time; # is cap-tuuured!...
> // "A good craftsman never blames his tools." --Keith Olbermann
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". 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". It appears twice
weekly in the group, but is not distributed in the digest.
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 V8 Issue 2197
**************************************