[8223] in Perl-Users-Digest
Perl-Users Digest, Issue: 1841 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Feb 9 20:27:23 1998
Date: Mon, 9 Feb 98 17:00:32 -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 Mon, 9 Feb 1998 Volume: 8 Number: 1841
Today's topics:
Re: "Mastering Regular Expressions" <*@qz.to>
Re: array question <tchrist@mox.perl.com>
Re: Binary Search Trees (Martien Verbruggen)
Re: Binary Search Trees <tchrist@mox.perl.com>
Re: Create new file on NT50? (Martien Verbruggen)
Re: Don't use signal handlers (was Re: Child processes) (Chip Salzenberg)
Re: Fork/Threads <dgoddard@us.oracle.com>
Re: getting perl system calls to run in different shell <tchrist@mox.perl.com>
Re: getting rid of duplicate lines in a file (Craig Berry)
Re: getting rid of duplicate lines in a file <tchrist@mox.perl.com>
Re: Happy with Perl? (Malcolm Hoar)
Re: Happy with Perl? (Will Morse)
Re: help: how to remove html tags from a file with perl <*@qz.to>
Re: How do I export environment variables? (Martien Verbruggen)
Re: How do I export environment variables? <tchrist@mox.perl.com>
Re: How do you call an .HTM from a Perl script? <tchrist@mox.perl.com>
Re: How to get a listing of the file that is linked? (Martien Verbruggen)
Re: How to tell if your CGI-related question belongs in (Malcolm Hoar)
How to write a perl module carloshd@hotmail.com
Killfile Triage <tchrist@mox.perl.com>
Re: Linux (David Efflandt)
LWP Error Message <andrew.spiers@virgin.net>
Re: making $( $) $< $> work for perl Win32 (David Efflandt)
Re: Perl Win32 and Require's <newspost@ . >
Re: Perl Win32 and Require's (Craig Berry)
Re: returning the date <tchrist@mox.perl.com>
Re: save, etc. using FileHandle instead of open (David Efflandt)
Re: Script runs, but not as batch <3.14@Math.MIT.edu>
The 'study' function (Ian Kallen)
Re: use of regex in INDEX <tchrist@mox.perl.com>
Re: where is the splitman program? (Martien Verbruggen)
Re: where is the splitman program? <tchrist@mox.perl.com>
Re: Year 2000 Compliance: Lawyers, Liars, and Perl <wayneb@beyond-software.com>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 9 Feb 1998 23:07:05 GMT
From: Eli the Bearded <*@qz.to>
Subject: Re: "Mastering Regular Expressions"
Message-Id: <qz$9802091750@qz.little-neck.ny.us>
Ilya Zakharevich <ilya@math.ohio-state.edu> wrote:
> Calle Dybedahl <qdtcall@esb.ericsson.se> wrote:
> > [1] For example, it points out the one case in which $`$&$' isn't
> > equivalent to the string matched on. I would never in a million
> I do not remember seeing this bug mentioned before. Is it fixed in
> newer version? Or is it a feature?
It is a feature. I forget the exact example, but it involved something
being undefined. For example:
#!/perl -w
$\ = "\n";
m//;
print q:$_ is defined: if defined($_);
print q:$` is defined: if defined($`);
print q:$& is defined: if defined($&);
print q:$' is defined: if defined($');
__END__
:r! perl -x %
Use of uninitialized value at /home/qz/.article.28509 line 4.
$` is defined
$& is defined
$' is defined
$`$&$' is the null string (and defined), but $_ is not defined.
Elijah
------
you should have realized it was a trick question Ilya
------------------------------
Date: 10 Feb 1998 00:34:31 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: array question
Message-Id: <6bo7an$q5$3@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, Dave Barnett <barnett@houston.Geco-Prakla.slb.com> writes:
:How about @array = (); ?
:That should empty @array.
:@array = undef; also works
God's Teeth, man, *what* are you talking about!? The latter
doesn't work at all! Test it. Learn.
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
: I've tried (in vi) "g/[a-z]\n[a-z]/s//_/"...but that doesn't
: cut it. Any ideas? (I take it that it may be a two-pass sort of solution).
In the first pass, install perl. :-) Larry Wall <6849@jpl-devvax.JPL.NASA.GOV>
------------------------------
Date: 9 Feb 1998 22:05:35 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Binary Search Trees
Message-Id: <6bnujf$goq$5@comdyn.comdyn.com.au>
In article <34DF6A50.332A3FBC@mail1.csun.edu>,
Ovanes Manucharyan <olm@mail1.csun.edu> writes:
> Is there any way to implement Binary Search Trees or AVL Trees in Perl.
>
> There must be a package around there that does this right?
> And also, how efficient is this algorithm compared to ones in C.
If there is, it should be listed on
http://www.perl.com/CPAN/modules/00modlist.long.html
You might also be interested in http://www.plover.com/~mjd/perl/,
where you can find an implementation of B-Trees.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | Inside every anarchy lurks an old boy
Commercial Dynamics Pty. Ltd. | network - Mitchell Kapor
NSW, Australia |
------------------------------
Date: 10 Feb 1998 00:23:26 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Binary Search Trees
Message-Id: <6bo6lu$q5$2@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, olm@mail1.csun.edu writes:
:Is there any way to implement Binary Search Trees or AVL Trees in Perl.
Sure. Why do you want to? You prefer the logarhytmic time of trees
to the constant of hashes for some nonobvious reason?
:There must be a package around there that does this right?
No, we know better.
:And also, how efficient is this algorithm compared to ones in C.
Oh, it'll be about 20 quintillions times slower. Don't do it.
You can find examples of this in the archive at
http://www.perl.com/misc/CS-Talk.tar.gz
Also see the BTREE bindings in DB_File.
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
Be consistent.
--Larry Wall in the perl man page
------------------------------
Date: 9 Feb 1998 21:43:00 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Create new file on NT50?
Message-Id: <6bnt94$goq$1@comdyn.comdyn.com.au>
In article <6bma26$fvl$1@news1.inet.tele.dk>,
<kenny@weng.dk> writes:
> $htmlfile = $FORM{'pagefile'};
Are you certain that $htmlfile now contains something valid? What
happens if it's an empty string? Or just a space?
> open(HTMLFILE,">$htmlfile") || die "Oppps, maybe there is more to write
> accress than I thought\n";
You should include the $! variable in that error message. It will give
you some more information about what exactly went wrong (probably a
permissions problem)
open(HTMLFILE,">$htmlfile") || die "Cannot open $htmlfile for writing: $!"
This error message will tell you in one swoop wether $htmlfile is
actually a valid name, and why it couldn't be opened for writing.
In addition to that: Have you read the two perl for CGI FAQs? They
might give you a hint as well:
http://www.perl.com/CPAN/doc/FAQs/cgi/perl-cgi-faq.html
http://www.perl.com/CPAN/doc/FAQs/cgi/idiots-guide.html
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | Little girls, like butterflies, need no
Commercial Dynamics Pty. Ltd. | excuse - Lazarus Long
NSW, Australia |
------------------------------
Date: Mon, 09 Feb 1998 22:09:59 GMT
From: chip@mail.atlantic.net (Chip Salzenberg)
Subject: Re: Don't use signal handlers (was Re: Child processes)
Message-Id: <6bnutv$evm$1@cyprus.atlantic.net>
According to eryq@zeegee.com:
> use safe_signals;
Malcolm says that will be possible in 5.005. As for 5.004, no,
there's no way at present to reach up through the entire call stack
and change the OP loop function. All the obvious ways are just as
much a slowdown as the signal patch itself. Some trick involving
longjmp/setjmp _may_ be possible; people are investigating.
--
Chip Salzenberg - a.k.a. - <chip@pobox.com>
"Nice shooting, Zanthar!" "Thanks, Denise." // MST3K
-> Ask me about Perl training and consulting <-
Like Perl? Want to help out? The Perl Institute: www.perl.org
------------------------------
Date: Mon, 09 Feb 1998 13:51:10 -0800
From: Denis Goddard <dgoddard@us.oracle.com>
Subject: Re: Fork/Threads
Message-Id: <34DF7A4E.9EB12CD9@us.oracle.com>
Tom Christiansen wrote:
>
> If you can't get fork to work, I promise that you'll never
> get threads to work.
>
... and see John Ousterhout's rants at
http://www.sunlabs.com/people/john.ousterhout/
Specifically:
http://www.sunlabs.com/people/john.ousterhout/threads.ppt
(Warning: posted as powerpoint slides)
-Denis
--
__ __ _ __ __
~~~~(__)|-< /-\(__ |__(-_ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Denis Goddard, Senior Member, Tech. Staff |"I see the heads of men arise
email: dgoddard@us.oracle.com |with hungry minds and open eyes!"
ourworld.compuserve.com/homepages/d_goddard| -Rush, from 2112: _The Oracle_
------------------------------
Date: 9 Feb 1998 22:56:25 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: getting perl system calls to run in different shells
Message-Id: <6bo1ip$pj8$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, Carey Pembroke <carey@tippett.com> writes:
:open(CMD, "|/bin/sh");
:print CMD "echo your shell command here";
:close(CMD);
You forgot a newline.
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
In general, if you think something isn't in Perl, try it out, because it
usually is. :-)
--Larry Wall in <1991Jul31.174523.9447@netlabs.com>
------------------------------
Date: 9 Feb 1998 21:51:59 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: getting rid of duplicate lines in a file
Message-Id: <6bntpv$kr2$4@marina.cinenet.net>
Remove xx to reply (xxTony.Curtis@vcpc.univie.ac.at) wrote:
: Re: getting rid of duplicate lines in a file, Tim
: <tim@hcirisc.cs.binghamton.edu> said:
:
: Tim> How would you go about getting a perl script to remove
: Tim> all duplicate lines in a file? I basically want to do
: Tim> the equivalent of `cat filename | uniq > filename` but
:
: ^^^^
: Perl buzz-word alert! Whoop! Whoop!
:
: If you find yourself thinking about duplicates and
: uniqueness, then you'll want to use a hash to see if
: something has already been processed.
:
: while (...) {
: next if $cached{$key};
:
: $cached{$key} = 1;
: ...
: }
You can even (for your specific 'cat file1 | uniq > file2' case) do this
as a one-liner:
while (<>) { print unless $cache{$_}++ }
---------------------------------------------------------------------
| 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: 9 Feb 1998 23:28:59 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: getting rid of duplicate lines in a file
Message-Id: <6bo3fr$pj8$5@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, Tim Gray <tim@hcirisc.cs.binghamton.edu> writes:
:How would you go about getting a perl script to remove all duplicate
:lines in a file? I basically want to do the equivalent of
:`cat filename | uniq > filename` but since this will be in perl for
:win32 I can't do it that way. Thanks.
The use of Microsoft crippleware systems is a sin that carries
with it its own punishment.
So is not reading perlfaq4, wherein the answer to your query
can be found.
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
A factor of 3000 is actually significant --Andrew Hume
------------------------------
Date: Mon, 09 Feb 1998 23:20:04 GMT
From: malch@malch.com (Malcolm Hoar)
Subject: Re: Happy with Perl?
Message-Id: <6bo2v0$avs$1@nntp1.ba.best.com>
In article <6bnbrg$iec$1@blinx.lizard.org>, markl@blinx.lizard.org (Mark Lewis) wrote:
>I am looking into the possibility of rewriting all the site-specific shell
>scripts for our company in perl, but am checking to see if anybody else
>has done this and wished they hadn't.
>is perl stable?
Yes, IMO. But not bug-free.
>would it be a good idea to risk millions of pounds on
>something that is unsupported? what do you think?
Remember that the Perl source code is available. So, you
could patch a serious bug yourself whereas, with most
commercial languages, you'd be at the mercy of the vendor.
--
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
| Malcolm Hoar "The more I practice, the luckier I get". |
| malch@malch.com Gary Player. |
| http://www.malch.com/ Shpx gur PQN. |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
------------------------------
Date: 9 Feb 1998 18:48:22 -0600
From: will@Starbase.NeoSoft.COM (Will Morse)
Subject: Re: Happy with Perl?
Message-Id: <6bo84m$cq2$1@Starbase.NeoSoft.COM>
In article <6bnbrg$iec$1@blinx.lizard.org>,
Mark Lewis <markl@blinx.lizard.org> wrote:
>I am looking into the possibility of rewriting all the site-specific shell
>scripts for our company in perl, but am checking to see if anybody else
>has done this and wished they hadn't.
I have a lot of perl scripts, but I wouldn't even think of rewritting
_ALL_, or even most of my Bourne shell scripts into perl. I would, and often
do, rewrite crummy vendor supplied csh scripts into sh (since sh will
easily translate into either ksh or bash), but not to perl without
some darn good reason.
perl is not a replacement for ALL shell scripts, it is a tool for a lot of good
things, "The Swiss Army Chainsaw of Computing", but you have to use the
right tool for the job.
>
>can somebody send me a list of other perl newsgroups to send this message to.
Don't. One is enough.
>
>is perl stable? would it be a good idea to risk millions of pounds on
>something that is unsupported? what do you think?
perl is more stable than Unix or X windows or, God knows, NT. What could
you possibly mean by "perl is unsupported"?
millions of pounds of what? :-)
--
# Copyright 1998 Will Morse. Internet repost/archive freely permitted.
# Hardcopy newspaper, magazine, etc. quoting requires permission.
#
# Gravity, # Will Morse
# not just a good idea, # Houston, Texas
# it's the law. # will@starbase.neosoft.com
#
# These are my views and do not necessarly reflect anyone else.
------------------------------
Date: 9 Feb 1998 22:56:49 GMT
From: Eli the Bearded <*@qz.to>
Subject: Re: help: how to remove html tags from a file with perl?
Message-Id: <qz$9802091516@qz.little-neck.ny.us>
Alex Dong Li <ali@genet.sickkids.on.ca> wrote:
> I need to remove 4 html tags from the following line (it is a single, long
> line):
> <a href="http://www.ncbi.nlm.nih.gov/htbin-post/Entrez/query?
> form=6&dopt=g&db=n&uid=02781378">gb|AC004014|AC004014</a> Human BAC clone
> RG022K14 from 7q22-q31, co... <a href = #2781378>351</a> 2e-95
...
> if ($line=~m/<[^>]+>/) {
> $line=~s/$&//g;
> }
Don't use $& except in the most basic of scripts. It slows down all RE
processing for the whole program. Second, nearly always when you put
a variable into the RE portion of a script and expect that variable to
match itself, you should use \Q$variable\E. Third, if you fix those
two mistakes, your code will still only remove one <...> block.
Tom Christiansen has argued that it is impossible to strip HTML tags
with an RE, but his argument hinges on dealing with broken HTML, so I
think that's cheating. Dealling with comments properly is quite complex,
but if you can ignore them, and you are willing to deal with entities
seperately, it is quite easy to do.
Just check the FAQ:
:r! ~/faqgrep -f "remove HTML"
=head2 How do I remove HTML from a string?
The most correct way (albeit not the fastest) is to use HTML::Parse
from CPAN (part of the libwww-perl distribution, which is a must-have
module for all web hackers).
Many folks attempt a simple-minded regular expression approach, like
C<s/E<lt>.*?E<gt>//g>, but that fails in many cases because the tags
may continue over line breaks, they may contain quoted angle-brackets,
or HTML comment may be present. Plus folks forget to convert
entities, like C<<> for example.
Here's one "simple-minded" approach, that works for most files:
#!/usr/bin/perl -p0777
s/<(?:[^>'"]*|(['"]).*?\1)*>//gs
If you want a more complete solution, see the 3-stage striphtml
program in
http://www.perl.com/CPAN/authors/Tom_Christiansen/scripts/striphtml.gz
.
Elijah
------
beware of comments though, they are killers
------------------------------
Date: 9 Feb 1998 21:57:54 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: How do I export environment variables?
Message-Id: <6bnu52$goq$4@comdyn.comdyn.com.au>
In article <34DF643D.41F17363@adobe.com>,
William Wishon <bwishon@adobe.com> writes:
> At the end of a config script I wrote I would like to export my
> environment variables. I want the perl script to leave the environment
> of the shell it's running in different than when it started. Then other
> commands executed from the shell that executed the perl script can use
> the modified environment variables.
The short answer is: You can't.
This question is answered in section 8 of the FAQ.
perldoc perlfaq8
/I {changed directory, modified my environment} in a perl
script. How come the change disappeared when I exited the
script? How do I get my changes to be visible?
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | If it isn't broken, it doesn't have
Commercial Dynamics Pty. Ltd. | enough features yet.
NSW, Australia |
------------------------------
Date: 10 Feb 1998 00:09:17 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: How do I export environment variables?
Message-Id: <6bo5rd$q5$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, William Wishon <bwishon@adobe.com> writes:
:At the end of a config script I wrote I would like to export my
:environment variables. I want the perl script to leave the environment
:of the shell it's running in different than when it started. Then other
:commands executed from the shell that executed the perl script can use
:the modified environment variables.
This is a FAQ.
$ man perlfaq8
I {changed directory, modified my environment} in a perl script.
How come the change disappeared when I exited the script? How do
I get my changes to be visible?
The answer is, you don't. That would be incestuous to screw around with
your parent process that way.
Hm... my new killfile isn't detecting you're posting from Windows.
Darn it.
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
It's documented in The Book, somewhere...
--Larry Wall in <10502@jpl-devvax.JPL.NASA.GOV>
------------------------------
Date: 9 Feb 1998 23:41:16 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: How do you call an .HTM from a Perl script?
Message-Id: <6bo46s$pj8$8@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, using X-Newsreader: Microsoft Internet News
4.70.1155, "Charles Wilkins" <thehelm@ibm.net> writes:
:I am trying to call up HTM documents form my Perl scripts without using an
:anchor tag (hyperlink). Can anybody tell me how to do it?
This just goes to show that my idea of killing any X-Mailer or
X-Newsreader from Win or Microsoft is justfied. :-)
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
There is, however, a strange, musty smell in the air that reminds me of
something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
--Larry Wall in Configure from the perl distribution
------------------------------
Date: 9 Feb 1998 21:50:32 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: How to get a listing of the file that is linked?
Message-Id: <6bntn8$goq$2@comdyn.comdyn.com.au>
In article <6bn4sg$9vs@panix.com>,
clay@panix.com (Clay Irving) writes:
> In <34DF946D.CCB74EB2@iris.eee.ntu.edu.sg> bz7347275@ntu.edu.sg writes:
>
>> I would like to know the time stamp of a file, but if it is
>>symlinked, i got to cd to that
>> directory to check on that file.
>> How can i script perl in the way to check for the sym link then get
>>the real time stamp
>> from the file?
>
> With lstat -- see perlfunc:
>
> lstat - stat a symbolic link
I think he actually was looking for a way to get the timestamp of the
file that the symlink was linked to.
Short of figuring out what the link is referring to, and doing a stat
on that file, I don't think you can do much. As far as I know, there's
no way of doing it directly. But then, I might be wrong.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | If at first you don't succeed, try
Commercial Dynamics Pty. Ltd. | again. Then quit; there's no use being
NSW, Australia | a damn fool about it.
------------------------------
Date: Tue, 10 Feb 1998 00:04:58 GMT
From: malch@malch.com (Malcolm Hoar)
Subject: Re: How to tell if your CGI-related question belongs in comp.lang.perl.misc
Message-Id: <6bo5jc$bv9$1@nntp1.ba.best.com>
In article <joe.mcmahon-0902981439290001@prtims.stx.com>, joe.mcmahon@gsfc.nasa.gov (Joe McMahon) wrote:
>(Note: I'd appreciate any additions/corrections to this posting - I'd like
>to turn it into a periodic posting to help cut the noise level.)
One other thing to add:
If the scrips runs from shell but fails when invoked as a CGI,
you've probably got a server config issue, bad pathnames (e.g.
the shebang header) or permissions issues. The question isn't
really appropriate here.
--
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
| Malcolm Hoar "The more I practice, the luckier I get". |
| malch@malch.com Gary Player. |
| http://www.malch.com/ Shpx gur PQN. |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
------------------------------
Date: Mon, 09 Feb 1998 16:34:29 -0600
From: carloshd@hotmail.com
Subject: How to write a perl module
Message-Id: <6bo09l$dol$1@nnrp2.dejanews.com>
Hi,
I'm a perl rookie trying to write a module with some custom functions;
but I can't find information or examples on how to write a module. Can
anyone tell me where to find the info or a quick tip on how to write
them. I'm running perl on WinNT4.0 (Perl5.003_07 ActiveState Port).
Thank you,
Carlos Diaz
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: 9 Feb 1998 22:16:24 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Killfile Triage
Message-Id: <6bnv7o$n1g$1@csnews.cs.colorado.edu>
Here is my semi-periodic post of my killfile (compatible with rn, trn,
strn, etc) that I use in the Perl newsgroups. The goal is to get rid of
the noise, the spam, and the incurably lame. This time, I'll annotate
it by related killings. Please understand that these are my personal
choices, and that some of the things I junk are perfectly legitimate
posting, and I hope you find help from someone else. I just don't care
to read them. (I know I should be using proper scorefiles, but I haven't
set that up yet.)
I have omitted the autoselect directives, which are almost universally
applied to those helpful, knowledgeable souls who have earned a reputation
for depth and clarity of thought in technical matters. I have omitted
any specific authors whom I killfile; such do exist, sadly enough.
You'll have to make your own decisions there, too.
First, the big expensive ones. The first of these kills articles with
"too many" cross postings. The next kills any subject that has no
lower-case letters in it; if you can't put a subject that doesn't scream,
I don't want to see it. The last directive in the following group
destroys any postings related to spam in any fashion. In particular,
this is to get rid of postings by people who like to put quirky "nospam"
gimmicks in their addresses, making it difficult to contact these people.
Let them eat /dev/null! Such "From" lines are not just a pain in the
butt; they are also not legal, and I zap illegal messages.
/xref:.*:.*:.*:.*:.*:/Hxref:j
/^Subject:[Re: ]*[^a-z]*$/c:j
/spam/h:j
If I could, I would also destroy all messages with a Re: in the subject
that don't have a References line. These too are illegal and annoying.
Since Perl version 4 is no longer supported, anything mentioning
it is immediately junked:
/perl *4/:j
Now we weed out postings related to the Evil One:
/\bDOS\b/:j
/\bM*IIS\b/c:j
/\bMS\b/:j
/\bNT\b/:j
/\bPC\b/c:j
/\bpc\b/:j
/\bdll\b/:j
/DOS\b/c:j
/dosperl/:j
/microsoft/:j
/NT/c:j
/ntperl/:j
/odbc/:j
/win *32/:j
/win *95/:j
/win3\.1/:j
/Windows/:j
/winnt/:j
If that doesn't go far enough, you might wish to also include the one or
of the following highly controversial killings. The first kills just
postings from Monoposoft postings, the second any news posting from a
mailer, since a newsreader is not a mailer. Another very good one to
kill is anything with MIME messages posted to the newsgroup. The last
line takes care of those. Nothing is more annoying than double-posted
messages, once in proper ASCII, once with idiotic HTML encodings.
This really helps clean out the cluefully challenged.
/X-(Newsread|Mail)er:.*(Microsoft|Win)/h:j
/X-Mailer/h:j
/Content-Type: multipart/h:j
I find the first particularly useful in destroying the miswrapped
lines stemming from brain-damaged "it's just another word processor"
newsreaders. You know,
those postings that always seem to go to the edge of the line and then
back
again to the start, as this paragraph has. These are just too painful
to read. Just kill them. It's not worth your time trying to figure
out what they're saying.
Now come the web killers. Blessed are they who killfile the web.
This gets rid of people posting web and cgi crud to the perl groups
instead of the cgi ones.
/attachment/:j
/\bcounters?\b/:j
/\bform\b/:j
/\bforms?\b/:j
/browser/:j
/\burl\b/:j
/cgi/:j
/download/:j
/html/:j
/IIS/c:j
/PerlII*S\.dll/:j
/proxy/:j
/script header/:j
/server error/:j
/upload/:j
/web/:j
/www/:j
Next die the platforms that I don't personally support or have anything
to do with:
/\be*macs*\b/:j
/\bVMS\b/:j
/hp-*ux/:j
/irix/:j
/macintosh/:j
/macperl/:j
/oracle/:j
/oracle/:j
/oraperl/:j
/solaris/:j
/sybase/:j
/sybperl/:j
I also don't deal with installation problems.
/install prob/:j
/installation prob/:j
/install/:j
Now for the subjects by broken excuses for newsreaders:
/(none)/:j
/no subject/:j
I don't read novice questions, which are generally answered in the FAQ.
I also have an irrational viscernal dislike of the word "newbie". I can't
explain this. It sets ringing cloying bells of saccharine sweetness,
making me think of some petulant, plaintive, and terminally spoiled
little Ivy-League sort of girliepooh named Muffy whiningly begging Mumsy
and Daddikums, "Oh please, Oh Please, *OH PLEASE*, can't you buy MEEEEEE
a new little internettie for MY Christmas? PUH-LEE-YUHZ?!?!?"
/novice/:j
/\bnewb[ieys]*\b/:j
Now for the strident pleas, which will fall on deaf ears. Note that this
intentionally avoids junking topics such as "need help with flocking".
/urgent/:j
/\bHELP\b/:j
/help!/:j
/!!!/:j
/???/:j
Finally the annoying spammage and junk postings. Most
of these now get killed at my nntp provider, but you never know
what might make it through.
/\bjob\b/:j
/fast money/:j
/FREE/c:j
/\$\$\$/:j
/jesus/:j
/make money/:j
/MISSING PERSON/c:j
/money fast/:j
/please read/:j
/quick money/:j
/recruiter/:j
/^test/:j
/wanted/:j
Happy newsreading! If anyone has other good killfile lines,
please share them with others.
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
There is no problem so small that it can't be blamed on Datakit --Andrew Hume
------------------------------
Date: Tue, 10 Feb 1998 00:52:08 GMT
From: efflandt@xnet.com (David Efflandt)
Subject: Re: Linux
Message-Id: <34e29fc7.5387397@flood.xnet.com>
cowboy@cnnw.net (James L. Taylor) wrote:
>Hi,
>
>I'm new to perl and I have been reading the news group here for a
>couple weeks and I have been noticing that alot of people talk about
>perl editors so they can do their work off line....how to a get one of
>these? are they free? if so where and what am I suppose to
>download...I've tried finding a few sites that have linux but I'm not
>sure what to get...can anyone tell a newbie what to look for??
>
>Thank You
>
>James L. Taylor
>www.bannerfx.com
Linux is a free operating system for PC's that can do most anything
you can do in UNIX. Though first time around I recommend buying it on
CD with a book. You can test perl CGI on your own local web server
for example. See the Linux specific newsgroups for more info.
You don't really need a special editor. Diehards use vi or emacs, but
pico is very easy (install the pine emailer that comes with Linux).
I have not checked out programs in the 'Perl Editor' threads so I am
not sure how they make programming easier. Error msgs or
strategically placed tmp print statements usually help troubleshoot.
David Efflandt/Elgin, IL USA
efflandt@xnet.com http://www.xnet.com/~efflandt/
------------------------------
Date: Mon, 09 Feb 1998 22:24:27 +0000
From: Andrew Spiers <andrew.spiers@virgin.net>
Subject: LWP Error Message
Message-Id: <34DF821A.A2CC10EA@virgin.net>
Does any one have any ideas about the following error :
Can't locate auto/LWP/UserAgent/env_proxy.al in @INC at
c:\perl\lib/LWP/Simple.pm line 158
BEGIN failed--compilation aborted at C:/PI3WEB/Cgi-Bin\get.pl line 3.
Setup: PI3web on Windows 95, Activeware win32 perl.
Script: Simple get
------------------------------
Date: Tue, 10 Feb 1998 00:03:41 GMT
From: efflandt@xnet.com (David Efflandt)
Subject: Re: making $( $) $< $> work for perl Win32
Message-Id: <34df970b.3151139@flood.xnet.com>
"B. K. Oxley (binkley)" <binkley@bigfoot.com> wrote:
>Is there any effort to make the user/group id variables work under Win32, if
>only partially? It may be problematic to make the fully equivalent to their
>counterparts on UNIX, but it seems proper to at least support them as
>read-only string variables, e.g., "$<" evaluating to "USER\DOMAIN".
>
>Of course, the "effective" versions make no sense, and the numeric versions
>would need to use GUIDs (128-bit numbers or equivalent structures) which is
>probably infeasible for the immediate future.
>
>--binkley
Is your 'send' button stuck (posted 3 times)?
Since DOS/Windows has no concept of group or user id this would be
tough to implement.
My boss thought he could keep people out of his machine by setting a
login password when Win95 starts. All you had to do was cancel the
login window and you could get into the machine without logging on.
If you want to do everything in perl just like in UNIX, install Linux.
David Efflandt/Elgin, IL USA
efflandt@xnet.com http://www.xnet.com/~efflandt/
------------------------------
Date: Mon, 09 Feb 1998 01:13:50 -0000
From: "GarryG" <newspost@ . >
To: comp.lang.perl.misc
Subject: Re: Perl Win32 and Require's
Message-Id: <01bd34f7$facdce00$0300a8c0@renegade>
I agree that the path is probably the problem.
Under NT on some servers no only is the working dir not the dir your script
is run from, but it changes between running the script through a dos box
and through a browser.
In my case the working dir is /cgi-bin or d:/sambar/cgi-bin. They are the
same.
Garry Goodwin
David Stack <dstack@netcom.com> wrote in article
<34dc74ac.684671@news.supernews.com>...
> I am having a problem using the "require" statement with perl on my
> windows 95 machine. The program is very simple and basically
> illustrates how to use the "require" statement.
>
> The program works fine when I run it from the DOS command line.
> But when I go to execute the same script through the webserver, I get
> the following error.
>
> >ERROR:
> >Message: CGI output from d:/musicstack/test/test.cgi
> >contained no blank line separating header and data
>
> If I comment out the "require" statement the program will work fine.
> Anyone have any ideas?
>
> Dave
>
>
------------------------------
Date: 10 Feb 1998 00:14:23 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Perl Win32 and Require's
Message-Id: <6bo64v$sd7$2@marina.cinenet.net>
David Stack (dstack@netcom.com) wrote:
: Not having an absolute path was the problem!
Glad to hear it...nice to be right about something now and then. :-)
: Before I originally posted to the net, I tried the full path,
: but I didn't have the slashes going the right direction.
:
: Perl on Win95
:
: PROPER: require "C:/web/test.pl"
: IMPROPER: require "C:\web\test.pl"
That's improper, but not for the reason you seem to think it is.
Backslash is an escape character, so (for example) the portion of
your path "\test" is being interpreted as "<tab>est". Double the
backslashes ("C:\\web\\test.pl") and it works fine.
However, a little-known fact is that, internally, DOS and its descendants
are perfectly happy with slashes going either way as path separators.
Only the command interpreter in DOS prevents you from using / when typing
in names (I'm sure there's a nice spot in Software Hell reserved for the
MS developer(s) who made this decision). Since the entire rest of the
world* uses forward-slashes exclusively, and since you can freely use them
in non-command-interface DOS work, I just always use forward slashes even
on NT servers. Makes the code both easier to read and easier to port.
: I really dislike silly syntax errors. Thanks for the tip.
You, me, and every other developer. You're welcome.
===
* OK, an exaggeration, and apologies to all you VAX/VMS, MVS
and other non-UNIX-like folks out there.
---------------------------------------------------------------------
| 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: 9 Feb 1998 23:38:15 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: returning the date
Message-Id: <6bo417$pj8$7@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
Wolfgang Denk <wd@denx.muc.de> writes:
:How about 1998-04-23 then? At least this can be easily used to sort
:the names in chronological order...
The problem, my dear Wolfgang, is that some of us don't automatically
intuit 1998-03-04 or 03-04-1998 to be in either March or April. More
specifically, you have your idea, but most of the net has another. :-)
--tom
PS: I say "most of the Net" because most of the net is North American,
for whom MMDDYY is the rule, not DDMMYY.
--
Tom Christiansen tchrist@jhereg.perl.com
/* And you'll never guess what the dog had */
/* in its mouth... */
--Larry Wall in stab.c from the v4.0 perl source code
------------------------------
Date: Tue, 10 Feb 1998 00:14:57 GMT
From: efflandt@xnet.com (David Efflandt)
Subject: Re: save, etc. using FileHandle instead of open
Message-Id: <34e099bf.3843428@flood.xnet.com>
Dean Hoover <dhoover@textwise.com> wrote:
>I want to do the kind of thing that is shown on page 193 of the
>camel book whereby STDOUT is redirected to a file. I want to
>use the FileHandle module to accomlish this (and also avoid
>BAREWORD warnings) but am unclear on how to go about it. The
>following is a distilled version of page 193:
>
>#!/home/dhoover/bin/perl
>
>open(SAVEOUT, ">&STDOUT");
>open(STDOUT, ">foo.out");
>select STDOUT; $| = 1;
>print "hello, world\n";
>close(STDOUT);
>open(STDOUT, ">&SAVEOUT");
>
>Any help will be appreciated.
>
>Dean Hoover
You should check if the open worked. The above can be done more
simply as:
#!/home/dhoover/bin/perl
open(SAVEOUT, ">foo.out") or die "Can't open foo.out: $!";
select SAVEOUT; $| = 1;
print "hello, world\n";
close SAVEOUT;
select STDOUT;
David Efflandt/Elgin, IL USA
efflandt@xnet.com http://www.xnet.com/~efflandt/
------------------------------
Date: Mon, 09 Feb 1998 19:25:02 -0500
From: Boris 'pi' Piwinger <3.14@Math.MIT.edu>
Subject: Re: Script runs, but not as batch
Message-Id: <34df9cef.0@news.netway.com>
mike@stok.co.uk (Mike Stok) wrote:
>Does batch honour #! lines,=20
That is obviously the problem. Thanks to Mike and Richard who provided
extended help to me by e-mail. Here the solution:
Leave the perl script as is (say vwd.pl).
Enter: batch -m
At the prompt enter: perl vwd.pl
Press: CTRL-d
Done.
That works, except for the script terminating when lynx can't access
the web page. I guess I have to perform a RTFM to find out how to fix
this. Though any hint is appreciated.
pi
--=20
Yogi Berra said:
>It's like deja vu all over again!
------------------------------
Date: 9 Feb 1998 23:24:17 GMT
From: spidaman@well.com (Ian Kallen)
Subject: The 'study' function
Message-Id: <6bo371$n8b$1@was.hooked.net>
I have yet to see in code or literature use of the 'study' function (I was
hoping the 'Effective Perl' book would touch on it, but it's still an
excellent book)... I'm looking for a good example (like with the Benchmark
module :) of benefits from 'study'
--
Ian Kallen <spidaman@well.com>
"Like so many Americans, she was trying to construct a life that made
sense from things she found in gift shops."
-- Kurt Vonnegut, Jr.
------------------------------
Date: 9 Feb 1998 22:20:38 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: use of regex in INDEX
Message-Id: <6bnvfm$n1g$2@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
rsignorino@yahoo.com writes:
:Trying to locate special tags that begin with
:an ampersand and end with a period in an HTML file.
:ex. (&MYSPECIALTAG.)
:
:I tried the INDEX function:
No, you didn't. You tried the index() function. There is no INDEX()
function.
: $position = index($line, /&[0-9a-zA-Z]\./i);
That's not the way the index function behaves! Doesn't matter though:
you can't use regular expressions to parse HTML. You need a parser.
These exist. See perlfaq9.
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
There is no reason for any individual to have a computer in their home. --Ken Olsen, 1977
------------------------------
Date: 9 Feb 1998 21:54:09 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: where is the splitman program?
Message-Id: <6bntu1$goq$3@comdyn.comdyn.com.au>
In article <6bnmec$3hb$1@news.ml.com>,
mwang@alhena.ibk.ml.com (Michael Wang) writes:
> Tom Christiansen <tchrist@mox.perl.com> wrote:
>>
>>These exist, but are not automatically installed. The splitman program
>>in the pod directory can be coerced into producing such.
>
> find * -name splitman -print
> in /usr/local could not produce anything. How about others? Thanks.
It's in the source distribution of perl. It doesn't get installed.
Check the ${Wherever_Perls_Sources_Live}/pod/splitman
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | Very funny Scotty, now beam down my
Commercial Dynamics Pty. Ltd. | clothes.
NSW, Australia |
------------------------------
Date: 9 Feb 1998 23:34:48 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: where is the splitman program?
Message-Id: <6bo3qo$pj8$6@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, mwang@alhena.ibk.ml.com (Michael Wang) writes:
:find * -name splitman -print
:in /usr/local could not produce anything. How about others? Thanks.
chthon(tchrist)% locate splitman
/usr/src/perl5.004_04/pod/splitman
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
"L'extension des privileges des femmes est le principe general de tous
progres sociaux."
--Charles Fourier, 1808
------------------------------
Date: Mon, 09 Feb 1998 15:57:42 -0800
From: "Wayne L. Beavers" <wayneb@beyond-software.com>
Subject: Re: Year 2000 Compliance: Lawyers, Liars, and Perl
Message-Id: <34DF97F6.6BC1@beyond-software.com>
Jon R. Kibler wrote:
>
>
> Exactly! The 1401 is the root of many of today's' problems, because
> files created on 1401s were often carried over to 360s and later
> systems. If I remember correctly, IBM had a 1401 emulator that would run
> Autocoder programs on systems as late as the 43xx systems -- and maybe
> even later than that.
>
> Old legacy systems never die!
>
> Thanks for the additions to my comments. For the young'ns out there, a
> little history in how we got where we are today helps with perspective.
>
At the company where I got my first programming job (1974) they were
still running Emma (the 1401 emulator) on the 360/30. This was so that
they could run the Fargo emulator(what ever that was) so that they could
run payroll. Payroll was a Fargo application.
Emma was microcode. Fargo was loaded from punched cards.
BTW, I saw punched card applications running as recently as 1986.
--
Wayne L. Beavers mailto:Wayne_Beavers@Beyond-Software.com
Beyond Software, Inc. http://www.beyond-software.com
"Transforming Legacy Applications"
------------------------------
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 1841
**************************************