[9021] in Perl-Users-Digest
Perl-Users Digest, Issue: 2640 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue May 19 13:08:46 1998
Date: Tue, 19 May 98 10:01:39 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Tue, 19 May 1998 Volume: 8 Number: 2640
Today's topics:
Perl terminology <Liznet@cookwood.com>
Re: Perl terminology (John Porter)
Re: Perl/Wall lingo question <keithmur@mindspring.com>
Re: Perl/Wall lingo question <keithmur@mindspring.com>
Re: Quick Question about Perl TCP/IP <aqumsieh@matrox.com>
Re: RE question <danboo@negia.net>
Re: regexp for strings of chars (Jari Aalto+mail.perl)
Re: Something like "Visual Perl"? (Stuart McDow)
Re: translate A-Z to 1-26 (Shaun Sides)
Re: translate A-Z to 1-26 <lr@hpl.hp.com>
Re: uniq in perl (John Klassa)
Re: while, each & assoc array <merlyn@stonehenge.com>
Re: while, each & assoc array <lyonsd@atl.hp.com>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 19 May 1998 11:22:10 -0400
From: Liz Castro <Liznet@cookwood.com>
Subject: Perl terminology
Message-Id: <3561A3A2.2B6B7434@cookwood.com>
If scripts are written in Perl, the programming language, what's the Perl that
you _install_ called--that is the MacPerl, or whatever local version you have
to compile (?), interpret (?), run (?) your scripts. Is it the "Perl
interpreter", the "Perl compiler" or the "Perl program"? Am I being too picky
wanting a word for this? Do you all (e.g., seasoned programmers...) just call
it "Perl"? What if you wanted to describe it in more detail?
Is there a book that starts at the _very_ beginning? (I have the camel and
llama and a bunch of others, but they all assume the reader is already a
programmer) Maybe I need a beginning programming book? Any suggestions?
Thanks.
------------------------------
Date: Tue, 19 May 1998 16:15:21 GMT
From: jdporter@min.net (John Porter)
Subject: Re: Perl terminology
Message-Id: <MPG.fcb7b9a842e85c79896d4@news.min.net>
On Tue, 19 May 1998 11:22:10 -0400,
in article <3561A3A2.2B6B7434@cookwood.com>,
Liznet@cookwood.com (Liz Castro) wrote:
> If scripts are written in Perl, the programming language, what's the Perl that
> you _install_ called--that is the MacPerl, or whatever local version you have
> to compile (?), interpret (?), run (?) your scripts. Is it the "Perl
> interpreter", the "Perl compiler" or the "Perl program"? Am I being too picky
> wanting a word for this? Do you all (e.g., seasoned programmers...) just call
> it "Perl"? What if you wanted to describe it in more detail?
Guess you didn't check out the FAQ.
You really ought to. It's very enlightening and entertaining,
answering questions such as these.
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....
And the very next FAQ:
Is it a Perl program or a Perl script?
It doesn't matter.
In "standard terminology" a program has been compiled to
physical machine code once, and can then be be run multiple
times, whereas a script must be translated by a program each
time it's used. Perl programs, however, 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 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.
> Is there a book that starts at the _very_ beginning? (I have the camel and
> llama and a bunch of others, but they all assume the reader is already a
> programmer) Maybe I need a beginning programming book? Any suggestions?
Sedgewick has a good family of books on algorithms;
Tanenbaum wrote several definitive texts on operating systems.
You'll also want to brush up on your discrete math (sets, relations,
graphs, etc.)
Comp.lang.perl.misc is a good place to post your perl-specific
questions which are not covered in the copious, extensive
documentation accompanying your perl distribution.
To get started with the docs, type
perldoc perldoc
at your command prompt.
Good luck,
John Porter
------------------------------
Date: Tue, 19 May 1998 10:51:57 -0500
From: "Keith G. Murphy" <keithmur@mindspring.com>
Subject: Re: Perl/Wall lingo question
Message-Id: <3561AA9D.3EDA9F65@mindspring.com>
Tom Christiansen wrote:
>
> And what do you call someone who gets an "MIS" degree from the Business
> School so they can become an "IT Professional?
"Boss", usually.
------------------------------
Date: Tue, 19 May 1998 11:02:12 -0500
From: "Keith G. Murphy" <keithmur@mindspring.com>
Subject: Re: Perl/Wall lingo question
Message-Id: <3561AD04.E6942CE1@mindspring.com>
thor wrote:
>
> Tom Christiansen wrote:
>
> > A very large program is bogging down the computer and management
> > wants to know why, so sets three different employees to solve
> > the problem.
> >
> > The computer scientist analyses the program's algorithm and
> > reduces it from cubic to logarithmic.
> >
> > The computer engineer finds nothing with his oscilloscope
> > so decides to install more swap space.
> >
> > The IT professional goes down to CompUSA and asks whether
> > there's a Microsoft Service Pack for this yet.
>
> meanwhile...
>
> The contract systems engineer (unix geek) renices the
> offending process into la-la land and not-so-politely
> chastizes the idiot who wrote/compiled/ran the job
> in front of above mentioned management.
>
> "by the way, here's my timesheet."
>
Reminds me of a story told by Bill Hancock at DECUS. This was supposed
to be true, but my poor recollection probably makes it much less so.
He wrote a program for a client that ran in some hours. "Too slow", the
client said.
He cleaned up some obvious time-wasters in the code. Got it down to,
oh, two hours. "Still too slow", the client said.
He really tweaked the hell out of it. Converted some key routines into
assembler. Got it down to 30 minutes. "Still too slow", the client
said.
"Just how fast does this need to run?"
"I wanna be back at the little prompt thingy right after I run it."
So he put it into a batch job and the client was happy.
This thread is just like a big coffee break, isn't it?
>
> thor
> god of thunder
Wow! Always wanted to meet you. How's the hammer? I was born on your
day, by the way...
------------------------------
Date: Tue, 19 May 1998 10:23:24 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: Quick Question about Perl TCP/IP
Message-Id: <356195DC.243992C8@matrox.com>
Jason Mclaughlin wrote:
> I was wondering if anyone knew how I could write a small Perl script to
> listen on a TCP port and when Someone connects send some text to them
> then disconnect, Kinna like a small server, Thanks
I do :-)
--
Ala Qumsieh | No .. not just another
ASIC Design Engineer | Perl Hacker!!!!!
Matrox Graphics Inc. |
Montreal, Quebec | (Not yet!)
------------------------------
Date: Tue, 19 May 1998 10:14:03 -0400
From: Dan Boorstein <danboo@negia.net>
Subject: Re: RE question
Message-Id: <356193AB.29ACA9A9@negia.net>
Yossi Klein wrote:
>
> On Tue, 19 May 1998, Dan Boorstein wrote:
>
> > Tom Mornini wrote:
> >
> > [SNIP]
> >
> > >
> > > The quest was matching and extracting the last two domain elements
> > > in an e-mail address to summarize subscribers to a mailing list.
> > >
> >
> >
> > it seems to be doing what you want in my estimation. however, i would
> > probably use something like:
> >
>
> I'm not a guru either, but let me try my hand at this anyway...
>
> First of all..
>
> > @last2 = (/([^.]+)/g)[-2,-1];
> >
> > or even:
> >
> > @last2 = (/([^.]+)/g)[-1,-2];
>
> won't work properly since there is no reference to the @. Therefore,
>
> a.b@c.d
>
> will get you
>
> b@c d
indeed you are correct. i was playing around with adresses of the
format 'danboo@smtp.negia.net' as well and forgot to add the '@'
back in when posting. simple enough to fix. just add '@' to the
character class.
@last2 = (/([^@.]+)/g)[-2,-1];
@last2 = (/([^@.]+)/g)[-1,-2];
or if you want to be a bit more (but still not perfectly) explicit:
@last2 = (/([a-zA-Z\d-]+)/g)[-2,-1];
@last2 = (/([a-zA-Z\d-]+)/g)[-1,-2];
which lets you deal directly with addresses in the format '<a@b.c>'.
thanks for catching that,
--
Dan Boorstein home: danboo@negia.net work: danboo@y-dna.com
"THERE IS AS YET INSUFFICIENT DATA FOR A MEANINGFUL ANSWER."
- Cosmic AC
------------------------------
Date: 19 May 1998 18:22:31 +0300
From: <jari.aalto@poboxes.com> (Jari Aalto+mail.perl)
Subject: Re: regexp for strings of chars
Message-Id: <tbd8dal1zc.fsf@blue.sea.net>
| 98-05-14 ilya@math.ohio-state.edu (Ilya Zakharevich) comp.lang.perl.misc
| > For overlapping matches, do this:
| >
| > my $string = 'aaaaaabbb,,,xyfooffff';
| > push(@trips, $1) while $string =~ m/(?=((.)\2{2}))/g;
|
| After almost-successful //h debate (heirarchical match) on p5p I
| decided to postpone implementing (?.REX) construct (which would hide
| parens/backrefs from the enclosing RE, and would start counting groups
| from 1). With such a construct, this might have been optimized to
|
| @trips = m/(?=((?.(.)\1{2})))/g
|
| and it might have been beautified to
|
| $triple = qr/(?.(.)\1{2})/;
|
| @trips = m/(?=($triple))/go;
|
| Note that I would be a little bit wary to use //g with zero-length
| expression - unless necessary. Though it looks hard to avoid it in
| the above construct. This
|
| @trips = m/.(?<=(?=($triple)).)/go;
...Eh, would someone translate these magic regexps to something
understandable. They are way of of my league. Thank you.
jari
------------------------------
Date: 19 May 1998 14:55:05 GMT
From: smcdow@arlut.utexas.edu (Stuart McDow)
Subject: Re: Something like "Visual Perl"?
Message-Id: <6js6g9$i9j$1@ns1.arlut.utexas.edu>
Heribert Wettels <wettels@respublica.de> writes:
>
> Has anybody heard about a programming environment for Perl similar to
> Visual Basic? Or at least an editor that creates indents and does some
> highlighting?
If you're an emacs kind of guy, there's a good port of it for NT.
http://www.cs.washington.edu/homes/voelker/ntemacs.html
--
Stuart McDow Applied Research Laboratories
smcdow@arlut.utexas.edu The University of Texas at Austin
"Look for beauty in roughness, unpolishedness"
------------------------------
Date: 19 May 1998 16:07:20 GMT
From: arch@abts.net (Shaun Sides)
Subject: Re: translate A-Z to 1-26
Message-Id: <slrn6m3876.la4.arch@abts.net>
Original message by: Juping Jin <juping+@pitt.edu>
Date: 18 May 1998 22:21:38 GMT
Subject: translate A-Z to 1-26
> I want to translate A-Z symbols to numberical symbols, and tried:
>
> s/([A-Z])/ord('\1')-65/g;
>
> but it doesn't work. How can I achieve this result?
I may be wrong, but it looks to me as if you could use:
tr/A-Z/1-26/g;
Lemme know if I'm just an idiot, though. ;-)
--
Shaun L. Sides arch@abts.net
Business web site http://www.abts.net/~arch
Showershoe web site http://www.abts.net/~arch/showershoe
Recreational web site http://sara.mmlc.nwu.edu/~arch
------------------------------
Date: Tue, 19 May 1998 08:47:26 -0700
From: "Larry Rosler" <lr@hpl.hp.com>
Subject: Re: translate A-Z to 1-26
Message-Id: <6js9je$ou8@hplntx.hpl.hp.com>
Shaun Sides wrote in message ...
>Original message by: Juping Jin <juping+@pitt.edu>
>Date: 18 May 1998 22:21:38 GMT
>Subject: translate A-Z to 1-26
>
>
>> I want to translate A-Z symbols to numberical symbols, and tried:
>>
>> s/([A-Z])/ord('\1')-65/g;
>>
>> but it doesn't work. How can I achieve this result?
>
>I may be wrong, but it looks to me as if you could use:
>
> tr/A-Z/1-26/g;
>
>Lemme know if I'm just an idiot, though. ;-)
You are perhaps not an idiot, but it *is* idiotic to submit such a
statement to a newsgroup without even a rudimentary test or reading the
documentation.
$_ = 'ABCD-WXYZ';
tr/A-Z/1-26/;
print;
prints: 1266-6666
Is anyone surprised?
--
Larry Rosler
Hewlett-Packard Laboratories
lr@hpl.hp.com
------------------------------
Date: 19 May 1998 15:04:14 GMT
From: klassa@aursgh.aur.alcatel.com (John Klassa)
Subject: Re: uniq in perl
Message-Id: <6js71e$b2k$1@aurwww.aur.alcatel.com>
On Mon, 18 May 1998 18:32:29 +0200, Thorbjoern Ravn Andersen wrote:
->$ cat whatever | perl -ne 'print if (! $seen_before{$_}++)'
"Congratulations! You win today's 'Useless Use of Cat' award... Johnny,
tell him what he's won..." :-)
...and where's Randal when you need him?
--
John Klassa / Alcatel Telecom / Raleigh, NC, USA <><
------------------------------
Date: Tue, 19 May 1998 15:31:04 GMT
From: Randal Schwartz <merlyn@stonehenge.com>
Subject: Re: while, each & assoc array
Message-Id: <8c7m3ixop3.fsf@gadget.cscaper.com>
>>>>> "John" == John Moreno <phenix@interpath.com> writes:
John> Ugh. I'm not sure whether you are over or under estimating the newbies,
John> but wouldn't expect anybody to do that (on the other hand my judgement
John> of what people will do is notoriously off).
For the past four years, I've spent nearly every day in front of a
room of people just grappling with the basics of Perl. You'd be
amazed at how many ways people can misinterpret what would appear to
be a clearly stated fact. (Sometimes, the programs end up being so
cut-n-pasted they look like Frankenstein's monster!) Then again,
maybe you wouldn't be. :)
print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,990.69 collected, $186,159.85 spent; just 105 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
------------------------------
Date: Tue, 19 May 1998 12:28:12 -0400
From: "David A. Lyons" <lyonsd@atl.hp.com>
Subject: Re: while, each & assoc array
Message-Id: <3561B31C.8DD4A481@atl.hp.com>
Jan Krynicky wrote:
>
> What about
>
> function
> {
> block;
> of code;
> }
>
> :-)
That's ok. As long as the beginning and ending braces line up, it's ok
with me!
> Anyway, it's just a matter of personal taste. Just
> remember that if the taste of the programer who ends up
> maintaining your code differs, you'd better not
> meet him in a dark corner ;-)
Actually, I *prefer* to meet a programmer in a dark corner. A
programmer sits around all day programming. He uses his brain, not his
brawn. Now somebody out digging ditches, or bucking hay bales all day
long...no thanks. ;^)
Dave
------------------------------
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 2640
**************************************