[11470] in Perl-Users-Digest
Perl-Users Digest, Issue: 5070 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Mar 6 00:07:27 1999
Date: Fri, 5 Mar 99 21:00:18 -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, 5 Mar 1999 Volume: 8 Number: 5070
Today's topics:
Re: Cross Platform DBMs <tchrist@mox.perl.com>
FAQ 1.11: What's the difference between "perl" and "Per <perlfaq-suggestions@perl.com>
FAQ 1.12: Is it a Perl program or a Perl script? <perlfaq-suggestions@perl.com>
FAQ 1.13: What is a JAPH? <perlfaq-suggestions@perl.com>
Re: Help With Code <ebohlman@netcom.com>
How to generate random alpha-numeric characters <dales@enhanced-performance.com>
Re: How to generate random alpha-numeric characters (Larry Rosler)
Re: I've flocked up (Alan Young)
IO::Socket and udp - Solution & a great reference! <ac256@ncf.ca>
Re: Looking for a spider script johnny99@sydney.dialix.oz.au
Newbie question <ajam@erols.com>
Re: Newbie question <ebohlman@netcom.com>
Re: Newbie question (Larry Rosler)
Re: Newbie question <ajam@erols.com>
Re: perl targeted url redirection. (Larry Rosler)
Re: print << "(END)" ? (Abigail)
Re: Printing in Perl (Tad McClellan)
Re: Programming a package sub that takes a reference to <rpsavage@ozemail.com.au>
Re: Programming a package sub that takes a reference to zenin@bawdycaste.org
Re: Regexp: split on ; but not on \; (Larry Rosler)
Re: Script Search <gsx97@usa.net>
Re: Sprite <ebohlman@netcom.com>
Re: without the awk! (Larry Rosler)
Re: Yesterday! (Abigail)
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 5 Mar 1999 20:21:22 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Cross Platform DBMs
Message-Id: <36e09f32@csnews>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
Colin Cyr <ccyr@home.com> writes:
:When you are invoking perl's db_open (or similar command) it is just
:using what ever dbm library it was compiled with, thus it can vary
:between systems.
That's why you put
use DB_File;
at the top.
--tom
--
MSDOS isn't dead. It just smells like it.
------------------------------
Date: 5 Mar 1999 16:40:58 -0700
From: Tom Christiansen <perlfaq-suggestions@perl.com>
Subject: FAQ 1.11: What's the difference between "perl" and "Perl"?
Message-Id: <36e06b8a@csnews>
(This excerpt from perlfaq1 - General Questions About Perl
($Revision: 1.21 $, $Date: 1999/01/26 09:55:05 $)
part of the standard set of documentation included with every
valid Perl distribution, like the one on your system.
See also http://language.perl.com/newdocs/pod/perlfaq1.html
if your negligent system adminstrator has been remiss in his duties.)
What's the difference between "perl" and "Perl"?
One bit. Oh, you weren't talking ASCII? :-) Larry now uses "Perl"
to signify the language proper and "perl" the implementation of
it, i.e. the current interpreter. Hence Tom's quip that "Nothing
but perl can parse Perl." You may or may not choose to follow
this usage. For example, parallelism means "awk and perl" and
"Python and Perl" look ok, while "awk and Perl" and "Python and
perl" do not. But never write "PERL", because perl isn't really
an acronym, apocryphal folklore and post-facto expansions
notwithstanding.
--
Let us be charitable, and call it a misleading feature :-)
--Larry Wall in <2609@jato.Jpl.Nasa.Gov>
------------------------------
Date: 5 Mar 1999 19:11:03 -0700
From: Tom Christiansen <perlfaq-suggestions@perl.com>
Subject: FAQ 1.12: Is it a Perl program or a Perl script?
Message-Id: <36e08eb7@csnews>
(This excerpt from perlfaq1 - General Questions About Perl
($Revision: 1.21 $, $Date: 1999/01/26 09:55:05 $)
part of the standard set of documentation included with every
valid Perl distribution, like the one on your system.
See also http://language.perl.com/newdocs/pod/perlfaq1.html
if your negligent system adminstrator has been remiss in his duties.)
Is it a Perl program or a Perl script?
Larry doesn't really care. He says (half in jest) that "a script
is what you give the actors. A program is what you give the
audience."
Originally, a script was a canned sequence of normally
interactive commands, that is, a chat script. Something like a
uucp or ppp chat script or an expect script fits the bill nicely,
as do configuration scripts run by a program at its start up,
such .cshrc or .ircrc, for example. Chat scripts were just
drivers for existing programs, not stand-alone programs in their
own right.
A computer scientist will correctly explain that all programs are
interpreted, and that the only question is at what level. But if
you ask this question of someone who isn't a computer scientist,
they might tell you that a *program* has been compiled to
physical machine code once, and can then be run multiple times,
whereas a *script* must be translated by a program each time it's
used.
Perl programs are (usually) neither strictly compiled nor
strictly interpreted. They can be compiled to a byte-code form
(something of a Perl virtual machine) or to completely different
languages, like C or assembly language. You can't tell just by
looking at it whether the source is destined for a pure
interpreter, a parse-tree interpreter, a byte-code interpreter,
or a native-code compiler, so it's hard to give a definitive
answer here.
Now that "script" and "scripting" are terms that have been seized
by unscrupulous or unknowing marketeers for their own nefarious
purposes, they have begun to take on strange and often pejorative
meanings, like "non serious" or "not real programming".
Consequently, some perl programmers prefer to avoid them
altogether.
--
Fungus doesn't take a vacation. --Rob Pike
------------------------------
Date: 5 Mar 1999 21:41:07 -0700
From: Tom Christiansen <perlfaq-suggestions@perl.com>
Subject: FAQ 1.13: What is a JAPH?
Message-Id: <36e0b1e3@csnews>
(This excerpt from perlfaq1 - General Questions About Perl
($Revision: 1.21 $, $Date: 1999/01/26 09:55:05 $)
part of the standard set of documentation included with every
valid Perl distribution, like the one on your system.
See also http://language.perl.com/newdocs/pod/perlfaq1.html
if your negligent system adminstrator has been remiss in his duties.)
What is a JAPH?
These are the "just another perl hacker" signatures that some
people sign their postings with. Randal Schwartz made these
famous. About 100 of the earlier ones are available from
http://www.perl.com/CPAN/misc/japh .
--
last|perl -pe '$_ x=/(..:..)...(.*)/&&"'$1'"ge$1&&"'$1'"lt$2'
That's gonna be tough for Randal to beat... :-)
--Larry Wall in <1991Apr29.072206.5621@jpl-devvax.jpl.nasa.gov>
------------------------------
Date: Sat, 6 Mar 1999 01:15:16 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Help With Code
Message-Id: <ebohlmanF85FHG.2AK@netcom.com>
pvdkamer@inter.NL.net wrote:
: I'm not that kind of good perl programmer at all, but i need help to
: speed up this script. This script is way to slow but i do not have the
: knowledge to make it faster.
: Please all the usefull comments are welcome.
: Script purpose :
: Compare two ascii files without delimmeters and without CTRL-LF
: The record lenght for both file is 256 characters fixed.
: find unique code from best20 in best40 and make a som of field $Opp
: Compare this with the field $Oppervlakte in best20
: If not the same print a line ......
The moment you hear the word 'unique' you should think 'hash'. The
reason your existing code is slow is that it has to make one complete
pass over best40 for every entry in best20. With hashes, you can make
*one* pass over best40, extracting your 'key' field and populating a hash
with it, and then make one pass over best20, looking up each key in the hash.
------------------------------
Date: Fri, 05 Mar 1999 17:33:31 -0800
From: Dale Sutcliffe <dales@enhanced-performance.com>
Subject: How to generate random alpha-numeric characters
Message-Id: <36E085EA.8B09FEF4@enhanced-performance.com>
How would I generate a string of 8 randomly chosen alpha-numeric
characters?
Thanks.
------------------------------
Date: Fri, 5 Mar 1999 19:09:50 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: How to generate random alpha-numeric characters
Message-Id: <MPG.114a3c58b705bfa99896fd@nntp.hpl.hp.com>
[Posted and a courtesy copy sent.]
In article <36E085EA.8B09FEF4@enhanced-performance.com> on Fri, 05 Mar
1999 17:33:31 -0800, Dale Sutcliffe <dales@enhanced-performance.com
>says...
> How would I generate a string of 8 randomly chosen alpha-numeric
> characters?
Using Perl's definition of alphanumeric characters:
my @chars = ('a' .. 'z', 'A' .. 'Z', 0 .. 9, '_');
my $string = join "", map $chars[rand @chars], 1 .. 8;
If you are using an old perl, you may have to seed the random-number
generator. `perldoc -f srand`.
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personl/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Sat, 06 Mar 1999 03:14:39 GMT
From: alany@2021.com (Alan Young)
Subject: Re: I've flocked up
Message-Id: <36e19d64.16627240@news.supernews.com>
[cc'd lee@easypress.co.uk]
On Fri, 26 Feb 1999 13:31:46 +0000, Lee Howells <lee@easypress.co.uk>
wrote:
>Do you get an error trying to open a locked file or does the system wait
>until the file is available again and then allow access?
It depends on how you handle it.
>I have the other bits sussed out (seek, truncate etc), I now need to
>know whether or not to wait for a file to open or not (it's hard to test
>for the above situation)
No it's not. Set a file to 0000 permissions and try to flock it and
see what happens.
--
Alan Young Technical Support
http://members.xoom.com/AlanYoung 2021.Interactive, LLC
If your happy and you know it, clunk your chains! http://www.2021.com
116 Randal said it would be tough to do in sed. He didn't say he didn't
understand sed. Randal understands sed quite well. Which is why he
uses Perl. :-) -- Larry Wall in <7874@jpl-devvax.JPL.NASA.GOV>
------------------------------
Date: 6 Mar 1999 00:00:35 GMT
From: "Douglas D. Dickinson" <ac256@ncf.ca>
Subject: IO::Socket and udp - Solution & a great reference!
Message-Id: <36E07013.E79CCADB@ncf.ca>
Many thanks to Guy Decoux <decoux@moulon.inra.fr> for sending me
the following pointer:
> Try to retrieve this message
> From: Tom Christiansen <tchrist@mox.perl.com>
> Subject: Re: Looking for example of IO::Socket for UDP Server
> Newsgroups: comp.lang.perl.misc
> Date: 27 Apr 1998 20:26:32 GMT
The article contained a *perfect* example of using UDP sockets with
Socket.pm for client-server communications. All hail Tom Christiansen!
(we're not worthy!). More than just code, it also contained a very
informative discussion of all the relevant issues.
This article *really* deserves to find it's way into the perlipc man
page (imho). It is available at:
http://x5.dejanews.com/[ST_rn=ps]/getdoc.xp?AN=348187344&CONTEXT=920677242.931266707&hitnum=1
The time server example in the perlipc man page only examined one
side of the client-server pair. I fooled with it unsucessfully
for a long time, but was unable to develop a working pair from
that start.
Don Roby wrote:
> Help for udp is indeed a bit more sparse than for tcp. But there is a good
> example in perlipc, demonstrating a time client that requests time from
> multiple servers and waits for the responses with a timeout.
All the best,
DouglasDD
--
Douglas D. Dickinson -- ac256@ncf.ca
<http://omega.scs.carleton.ca/~ddickins/>
------------------------------
Date: Sat, 06 Mar 1999 01:59:36 GMT
From: johnny99@sydney.dialix.oz.au
Subject: Re: Looking for a spider script
Message-Id: <7bq264$r5q$1@nnrp1.dejanews.com>
In article <linberg-0403991050180001@ltl1.literacy.upenn.edu>,
linberg@literacy.upenn.edu (Steve Linberg) wrote:
> > I'd very much like to have a perl script that could do a full
> > search of the site [...] listing of all documents and
> > directories, and some useful stuff
> > This must be possible, but, I can't seem to find it by searching at the
> > usual places.
> What "usual places" did you search, out of curiosity?
Sorry, I should have put soemthing like "the usual places I go to get
readymade scripts for things like guestbooks and email form handling, like
ScriptSearch.com and Staff.net" -- I'm really a complete PERL ignoramus, and
I was hoping there would be something which would help me do site analysis
like that which could be run from a web form and give me back something I
could format into HTML documents...
You've all paid me the compliment of assuming I know more than I do, or
perhaps that I'm the Unix guy. I'm just one of the website guys trying to
find reporting solution
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Fri, 05 Mar 1999 22:29:00 -0500
From: ajam <ajam@erols.com>
Subject: Newbie question
Message-Id: <36E0A0FC.941CB63C@erols.com>
--------------D0669AB77C0BDBD6A112C2BF
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Okay, this is my problem. I'm beginning to learn PERL, and I'm having a
little problem trying to do the following:
------------------------------------------------------------------------
$a1=1; $b1=2; @c1=(3, 4, 5);
sub func {
$a2=shift; $b2=shift;
for ($i=0; $i<3; $i++) {$c2[i]=shift;}
print "\$a=", $a2, " \$b=", $b2, " \@c=(", "@c", ")\n";
}
func($a1, $b1, @c1);
------------------------------------------------------------------------
Obviously, the intended output is: "$a=1 $b=2 @c=(3 4 5)"
I'm getting "$a=1 $b=2 @c=( 5)"
Suggestions??? Thanks!
--------------D0669AB77C0BDBD6A112C2BF
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<HTML>
Okay, this is my problem. I'm beginning to learn PERL, and I'm having
a little problem trying to do the following:
<BR>
<HR WIDTH="100%">
<BR>$a1=1; $b1=2; @c1=(3, 4, 5);
<P>sub func {
<P>$a2=shift; $b2=shift;
<P>for ($i=0; $i<3; $i++) {$c2[i]=shift;}
<P>print "\$a=", $a2, " \$b=", $b2, " \@c=(", "@c", ")\n";
<P>}
<P>func($a1, $b1, @c1);
<BR>
<HR WIDTH="100%">
<BR>Obviously, the intended output is: "$a=1 $b=2 @c=(3 4 5)"
<P>I'm getting "$a=1 $b=2 @c=( 5)"
<P>Suggestions??? Thanks!</HTML>
--------------D0669AB77C0BDBD6A112C2BF--
------------------------------
Date: Sat, 6 Mar 1999 03:55:13 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Newbie question
Message-Id: <ebohlmanF85Mw1.GwJ@netcom.com>
ajam <ajam@erols.com> wrote:
: for ($i=0; $i<3; $i++) {$c2[i]=shift;}
I'm guessing that you meant $c2[$i]. Enabling warnings helps you spot
typos like this right away.
------------------------------
Date: Fri, 5 Mar 1999 19:52:58 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Newbie question
Message-Id: <MPG.114a4674f9e0fe459896fe@nntp.hpl.hp.com>
[Posted and a courtesy copy sent.]
In article <36E0A0FC.941CB63C@erols.com> on Fri, 05 Mar 1999 22:29:00 -
0500, ajam <ajam@erols.com >says...
+ Okay, this is my problem. I'm beginning to learn PERL, and I'm having
+ a little problem trying to do the following:
+ ----------------------------------------------------------------------
+
+ $a1=1; $b1=2; @c1=(3, 4, 5);
+
+ sub func {
+
+ $a2=shift; $b2=shift;
+
+ for ($i=0; $i<3; $i++) {$c2[i]=shift;}
+
+ print "\$a=", $a2, " \$b=", $b2, " \@c=(", "@c", ")\n";
+
+ }
+
+ func($a1, $b1, @c1);
+ ----------------------------------------------------------------------
+
+ Obviously, the intended output is: "$a=1 $b=2 @c=(3 4 5)"
+
+ I'm getting "$a=1 $b=2 @c=( 5)"
+
+ Suggestions??? Thanks!
A very simple suggestion. Run your programs with the '-w' flag.
Always. Starting now!!! That will reveal two typos in your program.
Then start using 'use strict;', which would have revealed one of the
same typos for a slightly different reason.
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personl/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Fri, 05 Mar 1999 23:15:30 -0500
From: ajam <ajam@erols.com>
Subject: Re: Newbie question
Message-Id: <36E0ABE2.6BFB3684@erols.com>
--------------27CED5F7AF63F58F6565827A
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Oh, man! What an idiot!!!
As you can tell, I'm coming from 'C World!' And yes,
I'll start enabling warnings (-w) right away!!
I cannot believe I did that. But either way, I really
thank you for responding so fast.
I'm really enjoying PERL. But if I keep making these
moronic errors, ... Thanks again!
Cheers, ajam
------------------------------------------------------------------------
Eric Bohlman wrote:
> ajam <ajam@erols.com> wrote:
> : for ($i=0; $i<3; $i++) {$c2[i]=shift;}
>
> I'm guessing that you meant $c2[$i]. Enabling warnings helps you spot
> typos like this right away.
--------------27CED5F7AF63F58F6565827A
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<HTML>
Oh, man! What an idiot!!!
<P>As you can tell, I'm coming from 'C World!' And yes,
<BR>I'll start enabling warnings (-w) right away!!
<P>I cannot believe I did that. But either way, I really
<BR>thank you for responding so fast.
<P>I'm really enjoying PERL. But if I keep making these
<BR>moronic errors, ... Thanks again!
<P>Cheers, ajam
<BR>
<HR WIDTH="100%">
<BR>Eric Bohlman wrote:
<BLOCKQUOTE TYPE=CITE>ajam <ajam@erols.com> wrote:
<BR>: for ($i=0; $i<3; $i++) {$c2[i]=shift;}
<P>I'm guessing that you meant $c2[$i]. Enabling warnings helps you
spot
<BR>typos like this right away.</BLOCKQUOTE>
</HTML>
--------------27CED5F7AF63F58F6565827A--
------------------------------
Date: Fri, 5 Mar 1999 18:05:48 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: perl targeted url redirection.
Message-Id: <MPG.114a2d5aad14a5239896fc@nntp.hpl.hp.com>
In article <7bpu24$1ao$1@nnrp03.primenet.com> on Fri, 5 Mar 1999
17:57:34 -0700, Thomas Lehrer <tlehrer@spectrumdynamic.com> says...
> I'm trying to write a redirector that will update a frame, other than the
> frame that originally called the script. The redirection works but the
> targeted frame is not being updated. The frame that calls the script is the
> only one that is updated. Can anyone help.. Below is my script
Was it really necessary to post all of that table when you have not
asked a question that has anything to do with Perl?
--
Larry Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 6 Mar 1999 04:44:37 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: print << "(END)" ?
Message-Id: <7bqbrl$8p9$1@client2.news.psi.net>
Ketan Patel (ketanp@BLAHNOSPAMBLAHxwebdesign.com) wrote on MMXII
September MCMXCIII in <URL:news:36E01C41.E628C9A0@BLAHNOSPAMBLAHxwebdesign.com>:
\\
\\ Is there a one line answer? Does it have something to do with 'qw'?
qq
Abigail
--
perl5.004 -wMMath::BigInt -e'$^V=Math::BigInt->new(qq]$^F$^W783$[$%9889$^F47]
.qq]$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W]
.qq]98$^F76777$=56]);$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V
%$^U;$^V/=$^U}while$^V!=$^W'
------------------------------
Date: Fri, 5 Mar 1999 15:23:06 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Printing in Perl
Message-Id: <afepb7.jhq.ln@magna.metronet.com>
Larry Rosler (lr@hpl.hp.com) wrote:
: In article <slrn7e03dj.qse.hdiwan@diwanh.stu.rpi.edu> on 5 Mar 1999
: 17:00:51 GMT, the jackal <hdiwan@diwanh.stu.rpi.edu> says...
: > perldoc perlform
: I have never used Perl formatted output, because I never need to print
: reports of fixed page lengths with headers and footers. [s]printf has
: met all my needs (primarily to print HTML or to write files).
: Are there any benefits to Perl formats other than what I have noted
: above?
It gives you word-wrap without using a module.
But I never use it either.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sat, 6 Mar 1999 13:07:57 +1100
From: "Pen and Ron Savage" <rpsavage@ozemail.com.au>
Subject: Re: Programming a package sub that takes a reference to a variable.
Message-Id: <7bq2ph$7rp$1@reader1.reader.news.ozemail.net>
--
Cheers
Pen and Ron Savage
rpsavage@ozemail.com.au
http://www.ozemail.com.au/~rpsavage
Michael Preminger wrote in message <36DFF1C8.AF091E7@jbi.hioslo.no>...
>
>Within a package, I am trying to do the following
>sub updateEntryNoTree(%$*){
I would put the %Entry at the end, since, being an array, it gobbles up all
of @_.
>
> my(%Entry,$dbh,*index)=@_;
>
> code.....
>}
>
>so as to keep the value of $index across calls and returns.
>
>The perl interpreter says
>Variable "$index" is not imported at Bb_pack.pm line 264.
>
>What am I doing wrong?
>
>Thanks!
>Michael
>--
>Michael Preminger
>
>Forsker / Research Scientist
>Avdeling for journalistikk,
>bibliotek- og informasjonsfag /
>Faculty of Journalism, Library and
>Information Science
>Hxgskolen i Oslo / Oslo College
>
>http://www.hioslo.no/~michaelp
>
>Pilestredet 52, N-0167 Oslo
>Voice: +47-22452778
>Fax: +47-22452605
>E-mail: michael.preminger@jbi.hioslo.no
>
>
------------------------------
Date: 06 Mar 1999 03:20:06 GMT
From: zenin@bawdycaste.org
Subject: Re: Programming a package sub that takes a reference to a variable.
Message-Id: <920690493.408714@thrush.omix.com>
[posted & mailed]
[posted & mailed]
Michael Preminger <michael.preminger@jbi.hioslo.no> wrote:
: Within a package, I am trying to do the following
: sub updateEntryNoTree(%$*){
: my(%Entry,$dbh,*index)=@_;
: code.....
: }
: so as to keep the value of $index across calls and returns.
:
: The perl interpreter says
: Variable "$index" is not imported at Bb_pack.pm line 264.
:
: What am I doing wrong?
You can't my() a glob, not to mention that %Entry will eat up the
entire parameter list leaving $dbh and index undef.
You probably want something more like this:
sub updateEntryNoTree (\%$*) {
my %Entry = %{ shift }; ## passed by reference
my ($dbh, $index) = @_;
....code....
}
--
-Zenin (zenin@archive.rhps.org) From The Blue Camel we learn:
BSD: A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts. Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.) The full chemical name is "Berkeley Standard Distribution".
------------------------------
Date: Fri, 5 Mar 1999 18:01:18 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Regexp: split on ; but not on \;
Message-Id: <MPG.114a2c46ce7b26639896fb@nntp.hpl.hp.com>
In article <7bpsii$mbo$1@nnrp1.dejanews.com> on Sat, 06 Mar 1999
00:23:55 GMT, @l@ <aqumsieh@matrox.com> <@l@ <aqumsieh@matrox.com>>
says...
> In article <36de60ad.86493891@news.uni-X.net>,
> collin@rogowski.de (Collin Rogowski) wrote:
> > How can I split a String at ; but not at \;
>
> % perl -w
> $_ = 'this is a line ; with a line \; and another line ; finished';
> @a = split /[^\\];/;
> for (@a) {
> print ">> $_.\n";
> }
> __END__
> >> this is a line.
> >> with a line \; and another line.
> >> finished.
Bzzzt. This loses the character before the unescaped semicolon, which
in your example is conveniently a space. How about look-behind?
--
Larry Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Fri, 5 Mar 1999 19:39:45 -0500
From: "J. Parsons" <gsx97@usa.net>
Subject: Re: Script Search
Message-Id: <7bpth7$4tu@news1.snet.net>
You'll probably be covered in tar - not emailed.
There a ton of resources that do nothing except collect scripts. Take a look
around, you'll be amazed. You can start at http://www.scriptsearch.com
Have a blast!
Mike Rura wrote in message <36DF430E.CC449562@northeast.net>...
>A simple script to search my website by standard META-TAG KEYWORDS or
>search a simple database.
>
>Email me in .tar or .zip
>
>Mike
>
------------------------------
Date: Sat, 6 Mar 1999 01:39:45 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Sprite
Message-Id: <ebohlmanF85GM9.4Hw@netcom.com>
Christopher Pieper <curweb@cur.org> wrote:
: For the meantime, that is until I get our new server up and running I was
: interested in making a text file with all of our members names and email
: addresses, and porting it to the web and using a Perl script to allow for
: searching and sorting. I came across Sprite in a book I have yet I have
: found no real clear documentation on it, thus my inital efforts have all
: failed to work. Does anyone know where on the web I might find some
: information on this module, as in documentation. Or does anyone know of any
: other modules I can use to do searching and sorting with SQL of flat Text
: Based Databases? Mind you this is all done on someone elses server for the
: meantime so I can't really install any new progs like mySQL or such.
The POD documentation inside sprite.pm is pretty good. 'perldoc Sprite'
will display it for you, assuming you have Sprite installed on your machine.
You might also look into using DBI and DBD::CSV, which would reduce the
amount of extra work you'd have to do if you eventually switched to a
full-fledged RDBMS.
------------------------------
Date: Fri, 5 Mar 1999 17:46:57 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: without the awk!
Message-Id: <MPG.114a28eb99bc36129896fa@nntp.hpl.hp.com>
In article <7bps3t$m6m$1@nnrp1.dejanews.com> on Sat, 06 Mar 1999
00:16:05 GMT, @l@ <aqumsieh@matrox.com> <@l@ <aqumsieh@matrox.com>>
says...
...
> for my $temp (grep { /Disk/ } split /\n/, `smbclient $smbcmd`) {
The split into a list is not needed -- capture the command output
directly in list context.
The following requires a bit more typing, but is more appropriate when
searching for fixed strings, I think. This is analogous to the
difference between grep -E (old egrep) and grep -F (old fgrep, 'f' for
fast), though perl claims to use the same fast Boyer-Moore string
searching algorithm.
for my $temp
(grep index($_, 'Disk') >= 0, `smbclient $smbcmd`) {
Please let's not get into the silly debate about whether that 0 should
be $[ again!
--
Larry Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 6 Mar 1999 04:52:22 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Yesterday!
Message-Id: <7bqca6$8p9$2@client2.news.psi.net>
M.J.T. Guy (mjtg@cus.cam.ac.uk) wrote on MMXII September MCMXCIII in
<URL:news:7bp3i1$8l9$1@pegasus.csx.cam.ac.uk>:
== Benjamin Franz <snowhare@long-lake.nihongo.org> wrote:
== >>my ($d, $m, $y) - (localtime(time - 24*60*60))[3 .. 5];
== >>
== >>my $yesterday = sprintf("%02d%02d%4d", $d, $m+1, $y+1900);
== >
== >There really should be a FAQ entry on why that is a _bad idea_.
== >Days are NOT always exactly 24*60*60 seconds long and depending
== >on it is unwise: POSIX to the contrary, many boxes do account
== >for leap seconds.
==
== Why do people keep repeating this FUD? I know of no platform where
== time() includes leap seconds. It would be quite difficult to
== implement.
==
== >for leap seconds. 'localtime' can also can get tangled with
== >daylight savings shifts.
==
== Now there you have the real reason why days differ in length.
But do you know of a place where the *date* doesn't differ by
exactly one day when you go back 24*60*60 seconds, due to
daylight savings time?
Abigail
--
perl -weprint\<\<EOT\; -eJust -eanother -ePerl -eHacker -eEOT
------------------------------
Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
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 5070
**************************************