[10208] in Perl-Users-Digest
Perl-Users Digest, Issue: 3801 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Sep 23 15:08:21 1998
Date: Wed, 23 Sep 98 12:00:24 -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 Wed, 23 Sep 1998 Volume: 8 Number: 3801
Today's topics:
Re: -e file test? <richgrise@entheosengineering.com>
Re: Array of hashes: a better way? (Andre L.)
Re: can MSWord and Adobe PDF docs be read for indexing? <Arved_37@chebucto.ns.ca>
Re: Change chars in STDOUT? <featheredfrog@geocities.com>
Re: disable inharitance from parent (Mark-Jason Dominus)
Re: Double Quotes?? <richgrise@entheosengineering.com>
Re: Double Quotes?? (Larry Rosler)
emacs Perl mode and viper-paren-match <kin@omni.c-cube.com>
Re: Hashes springing into existence [Was: more regex/pa <dgris@rand.dimensional.com>
How can I change Excel's number style w/OLE? <jakek@u.washington.edu>
Re: How to implement (efficiently) an X minute cycle ? (Abigail)
Re: Intro To Perl tutorial - Chicago, 10/5-7/98 <perlguy@inlink.com>
Re: ORACLE database access problem (DBI) (John D Groenveld)
Re: Perl & Java - differences and uses <jdporter@min.net>
Re: Perl & Java - differences and uses <fsg@newsguy.com>
Perl network programming info request <philipNOSPAM@hrsites.com>
Re: Poll: How Did You Learn Perl? (Steve Manes)
Re: Poll: How Did You Learn Perl? <tturton@cowboys.anet-dfw.com>
Re: Poll: How Did You Learn Perl? (Larry Wall)
Re: Poll: How Did You Learn Perl? <dgris@rand.dimensional.com>
Re: Poll: How Did You Learn Perl? <eashton@bbnplanet.com>
Re: Poll: How Did You Learn Perl? <merlyn@stonehenge.com>
Re: problem retreiving cookie <richgrise@entheosengineering.com>
Re: Q: how to search/replace (s/...) extended ascii cha <richgrise@entheosengineering.com>
Re: Q: Picking an element from a hash (not knowing whic (Mark-Jason Dominus)
Regular Expression Beautifier <dgris@rand.dimensional.com>
Re: Simple, efficient way of checking whether $VAR is a <richgrise@entheosengineering.com>
Re: Simple, efficient way of checking whether $VAR is a <richgrise@entheosengineering.com>
Re: Simple, efficient way of checking whether $VAR is a <richgrise@entheosengineering.com>
Re: where is Date::Parse? droby@copyright.com
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 23 Sep 1998 13:29:42 -0500
From: Rich Grise <richgrise@entheosengineering.com>
To: Ken Quinn <kquinn@sk.sympatico.ca>
Subject: Re: -e file test?
Message-Id: <36093E16.2782@entheosengineering.com>
Ken Quinn wrote:
>
> I am having a problem with the following and was hoping someone may be
> able to help.
> $a = <STDIN>; #using filename | script.pl (to test from
> pipe).
Well, for one thing, the pipe is taking the stdout of whatever
`filename' does, and that's your $a. You could
$ cat > script.pl
myfilename
^D
(and there's probably a way to do this on the fly in one line,
but I'm not that good at UNIX yet)
or
$ script.pl whatfile
and instead of $a=<STDIN>;, say, $a=$ARGV[0];, but I'm probably
just confused.
--
Rich Grise
richgrise@entheosengineering.com
(No need to futz with my e-mail: I have a "Delete" button!)
------------------------------
Date: Wed, 23 Sep 1998 13:56:22 -0500
From: alecler@cam.org (Andre L.)
Subject: Re: Array of hashes: a better way?
Message-Id: <alecler-2309981356220001@dialup-647.hip.cam.org>
One way of improving the code (inline DATA file used for commodity):
#!/usr/bin/perl -w
use strict;
my $i = 0;
my @records;
while ( defined(my $line = <DATA>) ) {
chomp $line;
$i++, next if $line eq '';
my ($key,$value) = split /\s*=>\s*/, $line, 2;
$records[$i]{$key} = $value; # See Note.
}
foreach my $record (@records) {
print join('; ', map { "$_ => $record->{$_}" } keys %$record),
"\n";
}
__DATA__
eyes => blue
hair => brown
height => 70
weight =>
eyes => brown
hair => blonde
height => 62
eyes => blue
hair => red
weight =>
hair => ash brown
height => 65
weight => 120
-----
Note. If you want to discard the keys that have no corresponding value,
replace this line with:
$records[$i]{$key} = $value if $value ne '';
-----
HTH,
Andre
=======================================
In article <36090676.871794DA@amoco.com>, "Andrew W. Robinson"
<awrobinson@amoco.com> wrote:
> The code I have here works, but I was wondering if there was a
> better way. I have a data file that consists of multiline
> records, each line consisting of key-value pairs. The keys may
> vary between records and some may be missing values. I list an
> example below the code.
>
> My question concerns the section where I split the line, test the
> number of pieces and assign the hash accordingly. This seems
> clumsy. In the spirit of furthering my perl knowledge, is there a
> better, more elegant way of extracting the key-value pair from
> the line?
>
> Thanks!
>
> Andrew Robinson
> --
> Offshore Business Unit email: awrobinson@amoco.com
> Amoco Corporation phone: (504) 586-6888
> New Orleans, LA fax: (504) 586-2637
> -----
> The events depicted herein are fictional. Any similarity to
> persons living or dead is entirely...oops, wrong disclaimer
>
>
> ######### script file #########
> #!/usr/bin/perl -w
>
> $i = 0;
> open FIN, "test.dat" ;
> while ( $line = <FIN> ) {
> chomp $line;
> if ( $line =~ /^$/ ) {
> $i++;
> next;
> }
> @items = split /\s*=>\s*/, $line;
> if ( scalar @items == 2 ) {
> ${$records[$i]}{$items[0]} = $items[1];
> } else {
> ${$records[$i]}{$items[0]} = "";
> }
> }
> close FIN ;
>
> foreach $record ( @records ) {
> foreach $key ( keys %{$record} ) {
> print "$key=>${$record}{$key}; ";
> }
> print "\n";
> }
>
> ######## data file ########
> eyes => blue
> hair => brown
> height => 70
> weight =>
>
> eyes => brown
> hair => blonde
> height => 62
>
> eyes => blue
> hair => red
> weight =>
>
> hair => ash brown
> height => 65
> weight => 120
------------------------------
Date: Wed, 23 Sep 1998 14:47:51 -0300
From: Arved Sandstrom <Arved_37@chebucto.ns.ca>
Subject: Re: can MSWord and Adobe PDF docs be read for indexing?
Message-Id: <Pine.GSO.3.95.iB1.0.980923144126.25145B-100000@halifax>
The PDF Spec can be obtained from www.adobe.com. Perl is more than
adequate for working with PDF files, arguably it's the best tool for the
job.
Text in PDF is encoded (as opposed to encrypted), so you'll have to decode
page contents before getting at the text streams.
------------------------------
Date: Wed, 23 Sep 1998 14:06:21 -0400
From: "Michael D. Hofer" <featheredfrog@geocities.com>
Subject: Re: Change chars in STDOUT?
Message-Id: <3609389D.6D01@geocities.com>
Christopher Marquis wrote:
>
> I'm trying to do a cute little password routine. But I can't think of a
> way of replacing everything typed to echo back a "*" or something like
> it instead of what is really being typed.
...or have a look at section 15.10, p 529 of The Perl Cookbook:
use Term::ReadKey;
ReadMode 'noecho';
$password = ReadLine 0;
.
.
.
[no, I'm not going to quote the whole code - you can buy the book or
read the free documentation of Term:ReadKey from CPAN. Support your
documentors!!]
--
Cian ua'Lochan /mka/ Michael D. Hofer
I'm not a medievalist - I just play one on weekends!
http://www.geocities.com/SoHo/Lofts/9800/
------------------------------
Date: 23 Sep 1998 14:48:10 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: disable inharitance from parent
Message-Id: <6ubfpa$oon$1@monet.op.net>
In article <906503582.269054@thrush.omix.com>,
Zenin <zenin@bawdycaste.org> wrote:
>Mark-Jason Dominus <mjd@op.net> wrote:
>: In article <6u53h5$842$1@nnrp1.dejanews.com>, <dow.jones@home.se> wrote:
>: >What I'm worried about is that if the expression 'use CGI;' means that my
>: >program allocates memory even if I don't create a object... In that case, all
>: >my children will allocate the same amount of memory.. right?
>:
>: Probably not. Most modern unixes only copy the memory if one of the
>: processes modifies it, so the parent and child will share the memory
>: that is used for the code library. It will never be copied, and so
>: you'll never incur a space or a time cost.
>
> Only if perl is compiled with -Dusevfork=true.
You have confused copy-on-write with the semantics provided by
`vfork'. They are not the same thing at all. Time to reread the
`vfork' man page perhaps?
------------------------------
Date: Wed, 23 Sep 1998 12:36:37 -0500
From: Rich Grise <richgrise@entheosengineering.com>
Subject: Re: Double Quotes??
Message-Id: <360931A5.5A78@entheosengineering.com>
Brian Enderle wrote:
>
> When I use double quotes in a form and the information is passed to my
> cgi script for writing to a file, everything after the first double
> quote is lost. Example;
>
> input:
> This entire "line" should be written to the file.
>
> written to file:
> This entire
>
> I thought the &ReadParse function would take care of characters which
> require URI encoding.
>
Hm. Apparently not.
I had the same problem, but didn't use CGI.pm, so I had to go:
$subject =~ s/\"/"/;
Good Luck!
> Brian Enderle
--
Rich Grise
richgrise@entheosengineering.com
(No need to futz with my e-mail: I have a "Delete" button!)
------------------------------
Date: Wed, 23 Sep 1998 11:47:08 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Double Quotes??
Message-Id: <MPG.1072e205dc6e31d39897b2@nntp.hpl.hp.com>
[Posted to comp.lang.perl.misc and a copy mailed.]
In article <360931A5.5A78@entheosengineering.com> on Wed, 23 Sep 1998
12:36:37 -0500, Rich Grise <richgrise@entheosengineering.com> says...
...
> $subject =~ s/\"/"/;
$subject =~ s/"/"/g;
The double-quote is not a metacharacter in a regex, so the escape is
noise. The 'g' is because I doubt that one would want to change only the
first quote of a double-quoted string.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 23 Sep 1998 10:33:34 -0700
From: Kin Cho <kin@omni.c-cube.com>
Subject: emacs Perl mode and viper-paren-match
Message-Id: <cohlnnaohsh.fsf@omni.c-cube.com>
viper-paren-match can't handle the following Perl code very well:
{
${$pkg.'::currel'} = 1;
}
Attempting to match the closing curly brace at line 3 from the opening
brace at line 1 fails -- matching the closing curly brace at line 2 instead.
This failure doesn't happen if the above code is not in a Perl
mode buffer.
I also tried cperl mode with similar results.
Any ideas?
-kin
------------------------------
Date: Wed, 23 Sep 1998 18:46:08 GMT
From: Daniel Grisinger <dgris@rand.dimensional.com>
Subject: Re: Hashes springing into existence [Was: more regex/pattern substitution]
Message-Id: <6ubeor$adm$1@rand.dimensional.com>
[posted to comp.lang.perl.misc and mailed to the cited author]
In article <6ub6lo$5le$1@mathserv.mps.ohio-state.edu>
ilya@math.ohio-state.edu (Ilya Zakharevich) wrote:
>Well, you confuse PP-code with Perl API. pp_exist() may be not
>called, but it is only a wrapper for hv_fetch(...,FALSE) (I did not
>look into the code, though). And hv_fetch is called before doing
>newHV() anyway.
But pp_exists isn't a wrapper for hv_fetch, it's a wrapper
for hv_exists_ent and avhv_exists_ent (which itself is just
a wrapper around hv_exists_ent), neither of which are
called when a new HV is created, and neither of which call
hv_fetch.
Am I missing something?
dgris
--
Daniel Grisinger dgris@perrin.dimensional.com
`By about halfway through I was beginning to guess the
ending, but it still kind of surprised me.'
David Hatunen, talking about the movie Titanic
------------------------------
Date: Wed, 23 Sep 1998 11:45:19 -0700
From: Jake Kreutzer <jakek@u.washington.edu>
Subject: How can I change Excel's number style w/OLE?
Message-Id: <Pine.A41.3.96a.980923111739.27756A-100000@dante28.u.washington.edu>
We are moving (or attempting to move =) a bunch of old data that
are currently in Excel spreadsheets into an Oracle database. In the
interests of ease of database programming a lot of the information has to
be converted to numbered indices. I downloaded and installed Win32::OLE,
no problems, and wrote a program to do the substitution. It works fine,
except that Excel trims the leading 0's off of the numbers when they are
put into their cells. This is a problem, as most of the numbers look like
00001, 00012, etc.
To fix this, all I have to do is change the number style from
"general" to "text" in the affected columns. Since it would be a royal
pain to change it manually, I figured I would try to change it within my
perl program. Here is the subfunction that I wrote. It is supposed to take
in a reference to an array of column letters and change the number style
in that column to whatever it was fed:
sub setColumnStyle {
my($r_columns, $sheet, $style) = @_;
#debugging stuff...
print "I was passed:\n$r_columns\n$sheet\n$style\n\n";
#end debugging stuff
foreach my $columnLetter (@$r_columns) {
print "$columnLetter\n";
$range = $columnLetter . "1:" . $columnLetter . "100";
#Thought the style->{Locked} variable might mean something
$sheet->Range($range)->{Style}->{Locked} = 0;
print "style locked is " . $sheet->Range($range)->{Style}->{Locked} . "\n";
$sheet->Range($range)->{Style}->{NumberFormat} = $style;
$sheet->Range($range)->{Style}->{NumberFormatLocal} = $style;
print "Style is " . $sheet->Range($range)->{Style}->{NumberFormat} . "\n";
print "Style should be $style\n";
}
}
Unfortunately, it doesn't work. Here is the output when passed $xlText and
"Text" for $style, respectively ($r_columns = ['a', 'e', 'n'] for each).
c:\autoexcel> perl massager.plx
I was passed:
ARRAY(0x112399c)
Win32::OLE=HASH(0x112ec8c)
-4158
a
style locked is 0
Style is General
Style should be -4158
e
style locked is 0
Style is General
Style should be -4158
n
style locked is 0
Style is General
Style should be -4158
c:\autoexcel> perl massager.plx
I was passed:
ARRAY(0x112399c)
Win32::OLE=HASH(0x112ec98)
Text
a
style locked is 0
Style is General
Style should be Text
e
style locked is 0
Style is General
Style should be Text
n
style locked is 0
Style is General
Style should be Text
Can anybody tell me why this doesn't work, and possibly point me towards
a solution to this problem (or some comprehensive documentation of the
module)?
For reference, the Excel object model (such as it is) is at:
http://www.microsoft.com/OfficeDev/Articles/OMG/naug04xl.htm
Thanks for your time,
Jake Kreutzer
Early bird gets the worm, but the second mouse gets the cheese.
------------------------------
Date: 23 Sep 1998 18:03:01 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: How to implement (efficiently) an X minute cycle ?
Message-Id: <6ubd4l$68f$1@client3.news.psi.net>
Calle Dybedahl (qdtcall@esb.ericsson.se) wrote on MDCCCXLIX September
MCMXCIII in <URL: news:isaf3q2a80.fsf@godzilla.kiere.ericsson.se>:
++ aharon@deltathree.com (Aharon (Al) Schkolnik) writes:
++
++ > while (1)
++ > {set timer to expire in 10 minutes;
++ > do some stuff;
++ > wait for timer
++ > }
++
++ > Is there a better way ?
++
++ while(1)
++ {
++ fork();
++ if(in_child)
++ do some stuff;
++ exit;
++ else
++ sleep 600;
++ }
But what if some stuff takes more than 600 seconds?
This doesn't use a fork():
while (1) {
$then = 600 + time;
do some stuff;
sleep ($then - time);
}
Abigail
--
perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'
------------------------------
Date: Wed, 23 Sep 1998 17:25:22 GMT
From: Brent Michalski <perlguy@inlink.com>
Subject: Re: Intro To Perl tutorial - Chicago, 10/5-7/98
Message-Id: <36092F02.9527AB76@inlink.com>
John Donnelly wrote:
> ***Introduction To Perl For Programmers***
...SNIP...
> NOTE: While this course is based on the current release of
> Perl (version 5.004), it is not intended to be a detailed
Uh John, the current release of Perl is 5.005, there were several
enhancements made to the new version...
brent
--
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$ Brent Michalski $
$ -- Perl Evangelist -- $
$ E-Mail: perlguy@technologist.com $
$ Resume: http://www.inlink.com/~perlguy $
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
------------------------------
Date: 23 Sep 1998 14:21:14 -0400
From: groenvel@cse.psu.edu (John D Groenveld)
Subject: Re: ORACLE database access problem (DBI)
Message-Id: <6ube6q$k4n$1@tholian.cse.psu.edu>
Current versions of DBI/DBD::Oracle have a different connect syntax.
my $dbh = DBI->connect(
"dbi:Oracle:MyDBAlias",
"scott",
"tiger",
{ RaiseError => 1 }
);
John
groenveld@acm.org
------------------------------
Date: Wed, 23 Sep 1998 14:06:44 -0400
From: John Porter <jdporter@min.net>
Subject: Re: Perl & Java - differences and uses
Message-Id: <360938B4.A487FE05@min.net>
George Reese wrote:
>
> In comp.lang.java.programmer John Porter <jdporter@min.net> wrote:
> : George Reese wrote:
> :>
> :> I have not referenced myself as an authority and I do not reference
> :> anyone else as an authority. Argument from authority is an invalid
> :> form of argument. I have presented an argument that you can take or
> :> leave on its own merits.
>
> : Thank you, I will leave them on their own "merits".
> : But you are double-talking when, in one breath you say
>
> :> you will not take my explicit statements as proof.
>
> : And in the next say
>
> :> I have not referenced myself as an authority.
>
> Reread the question you asked me:
>
> "So, are we unclear as to where you stand on OO?"
>
> And, the above quote, you got from the following reply:
>
> "Evidently, you are. And what is really funny, you will not take my
> explicit statements as proof. You instead spend a lot of time reading
> into other statements non-explicit meanings."
It doesn't matter where I got the quote.
You claimed to have never referenced yourself as an authority;
yet the written record contradicts you.
> Not only am I an authority on where I stand, what I say about where I
> stand is the best evidence in the world of where I stand. In order to
> know where I stand, you have to observe my behaviours. Which, in the
> case of USENET, lies entirely within what I say. What are you looking
> for?
At the risk of repeating myself unnecessarily --
I am not looking for proof that you think the way you say you do;
that is utterly irrelevant. I am looking for proof of the
objective assertions you have made -- about OO, about Python, about
Perl, about software engineering.
Surely you're not suggesting that the things you've asserted are
true merely by virtue of having been said by you?
> : As I said before, there is nothing wrong with citing well-respected
> : sources as support for your position. Such argument from authority
> : is not invalid.
>
> I very much disagree. I think argument from authority is meaningless
> and that's why I have not appealed to any of those that do support my
> position.
That is a matter of opinion.
Even if you think I'm irrational for being content with citations
from recognized authority, you could have satisfied me with some
such citations. The fact that you haven't indicates to me that
either you can't be bothered, or you're not certain that any such
authorities even exist. Now, if the former is the case, I really
can't blame you; this silly debate has already taken up too much
of our time.
> That Dijkstra said all of that is 100% uninteresting to me and I would
> never take it to have any meaning. What is important are the
> arguments in question. And above you provide a good argument against
> GOTO simply by quoting him.
I did?
Then why can't you dredge up a few quotes from people I've heard of?
--
John "Many Jars" Porter
------------------------------
Date: Wed, 23 Sep 1998 10:56:36 -0700
From: "Felix S. Gallo" <fsg@newsguy.com>
Subject: Re: Perl & Java - differences and uses
Message-Id: <6ubchg$7bs@enews3.newsguy.com>
George writes:
>You are bordering on ridiculous if you think you need to support your
>premises. Such an argument is an infinite regression. A proper
>argument states premises and a conclusion. Then others may disagree
>with the validity of the argument (it does not follow from the
>premises) or they disagree with a specific premise. At that point we
>can delve into problems with a specific premise if there are any.
I've been on the network-now-known-as-the-Internet for lo these
15 years. At an average of 6 hours a day, 365 days a year, that's
32,850 hours. With an average reading speed of about 100 wpm,
I've probably read about 197,100,000 words (bypassing a terabyte
just a few years ago).
So I would count it as a serious achievement by George Reese that
his quoted paragraph is possibly one of the most hilariously half-
witted concoctions I've ever read.
'You are bordering on ridiculous if you think you need to support
your premises. Such an argument is an infinite regression.' I
savor this. It's so beautiful in so many ways; so perfect; so exact.
'A proper argument states premises and a conclusion. Then others
may disagree with the validity of the argument [...] or they disagree
with a specific premise. At that point we can delve into problems
with a specific premise if there are any.' This is just _achingly_
great -- a new time-linear organization imposed upon argumentation
in a newsgroup Usenet by authoritative statement! Oh, capital!
Really, this thread should end here, to preserve this distilled
majesty in dejanews for eternity.
Felix
------------------------------
Date: Wed, 23 Sep 1998 14:00:12 -0500
From: Philip Parker <philipNOSPAM@hrsites.com>
Subject: Perl network programming info request
Message-Id: <3609453C.B69D7C54@hrsites.com>
I see lots of relevant modules in my searches but I'm new to network
programming and need to see some how-to info on network programming in
general. Is there any tutorial type info concerning network programming
in Perl? I would much prefer Perl but could read C code if necessary.
Thanks for any help.
Philip Parker
philipNOSPAM@hrsites.com
------------------------------
Date: Wed, 23 Sep 1998 17:38:46 GMT
From: smanes@NOSPAM.HEREmagpie.com (Steve Manes)
Subject: Re: Poll: How Did You Learn Perl?
Message-Id: <364131cb.1002480273@news.panix.com>
On Wed, 23 Sep 1998 12:38:04 -0400, John Porter <jdporter@min.net>
wrote:
>So here's a poll for everyone.
>
>From what resource(s) did you learn Perl?
Camel v.1, which although not as informative or up-to-date as Camel
v.2., I still find to be a bit better organized as a reference source
for the basic stuff.
------------------[ http://www.magpie.com ]-----------=o&>o-------
Steve Manes smanes [at] magpie.com N'Yawk, N'Yawk
------------------------------
Date: Wed, 23 Sep 1998 13:08:15 -0500
From: Tom Turton <tturton@cowboys.anet-dfw.com>
Subject: Re: Poll: How Did You Learn Perl?
Message-Id: <3609390F.CEC572BA@cowboys.anet-dfw.com>
> From what resource(s) did you learn Perl?
>
> . Llama v.1
> . Llama v.2
> . Camel v.1
> O Camel v.2 (on order along with Advanced Perl Programming
and Mastering Regular Expressions
> X Other book (Teach Yourself PERL 5 in 21 days - SAMS) 80%
> X Docs included in the distribution 10%
> X Something on the WWW(monitoring C.L.P.M) 10%
> . Studying existing code
> . Class/tutor
---Tom Turton (miles to go before I call myself JAPH... for now, call me
Just Another Perl Newbie)
------------------------------
Date: 23 Sep 1998 11:25:18 -0700
From: larry@kiev.wall.org (Larry Wall)
Subject: Re: Poll: How Did You Learn Perl?
Message-Id: <6ubeee$m64@kiev.wall.org>
In article <360923EC.8E9919D0@min.net>, John Porter <jdporter@min.net> wrote:
>From what resource(s) did you learn Perl?
>
>. Llama v.1
>. Llama v.2
>. Camel v.1
>. Camel v.2
>. Other book (give name)
>. Docs included in the distribution
>. Something on the WWW
>. Studying existing code
>. Class/tutor
I dunno how I learned it. Perl just seemed intuitively obvious to me.
Larry
------------------------------
Date: Wed, 23 Sep 1998 18:15:30 GMT
From: Daniel Grisinger <dgris@rand.dimensional.com>
Subject: Re: Poll: How Did You Learn Perl?
Message-Id: <6ubd1d$ac3$1@rand.dimensional.com>
[posted to comp.lang.perl.misc and mailed to the cited author]
In article <360923EC.8E9919D0@min.net>
John Porter <jdporter@min.net> wrote:
>From what resource(s) did you learn Perl?
You forgot toke.c (oh, never mind, that's how I learned
C, not perl :-).
Mark me down as learning from the camel v2 and from
the core docs.
dgris
--
Daniel Grisinger dgris@perrin.dimensional.com
`By about halfway through I was beginning to guess the
ending, but it still kind of surprised me.'
David Hatunen, talking about the movie Titanic
------------------------------
Date: Wed, 23 Sep 1998 18:38:12 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Re: Poll: How Did You Learn Perl?
Message-Id: <36093DA8.FB74B02@bbnplanet.com>
Larry Wall wrote:
> I dunno how I learned it. Perl just seemed intuitively obvious to me.
Show off ;)
e.
"All of us, all of us, all of us trying to save our immortal souls, some
ways seemingly more round-about and mysterious than others. We're having
a good time here. But hope all will be revealed soon." R. Carver
------------------------------
Date: Wed, 23 Sep 1998 18:48:09 GMT
From: Randal Schwartz <merlyn@stonehenge.com>
Subject: Re: Poll: How Did You Learn Perl?
Message-Id: <8cyarawtrf.fsf@gadget.cscaper.com>
>>>>> "Larry" == Larry Wall <larry@kiev.wall.org> writes:
Larry> I dunno how I learned it. Perl just seemed intuitively obvious to me.
Oh, c'mon Larry, you told me once that *you* even refer to the manpage
occasionally.
:-)
--
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: Wed, 23 Sep 1998 13:34:55 -0500
From: Rich Grise <richgrise@entheosengineering.com>
To: Guillaume Buat-Menard <guillaume@nospam.com>
Subject: Re: problem retreiving cookie
Message-Id: <36093F4F.1523@entheosengineering.com>
Guillaume Buat-Menard wrote:
>
> Hi all,
>[...]
> ... $ENV{HTTP_COOKIE}
>[...]
> If not have you got any Idea why my cookie string is empty?
>
> thanks for your help,
>
> Guillaume.
Well, I don't know if this is right or not, but try $ENV{'HTTP_COOKIE'}
(note single quotes ``'")
--
Rich Grise
richgrise@entheosengineering.com
(No need to futz with my e-mail: I have a "Delete" button!)
------------------------------
Date: Wed, 23 Sep 1998 12:54:44 -0500
From: Rich Grise <richgrise@entheosengineering.com>
To: "Serge G." <sergeg@odyssee.net>
Subject: Re: Q: how to search/replace (s/...) extended ascii characters?
Message-Id: <360935E4.4CC7@entheosengineering.com>
Serge G wrote:
>
> Hi, y'all,
>
> Anybody out there kind enough to explain / illustrate how does one
> search and replace (Perl Win32, v5.02, methinks) extended ascii
> characters? Only hint I got in this NG was how to search and replace
> some "owithumlautoverit", using it's hex value, which was not of much
> use to me, not knowing the hex values of french extended asciis... :(
>
> Or (wishful thinking mode engaged), any routine out there for
> translating extended asciis to their HTML equivalent?
>
> TIA,
>
> /sergeg ;(
I dashed off this little quickie in VB one day, to put copyright
symbols into my HTML:
char
hex
decimal (HTML)
! = %21 = !
" = %22 = "
# = %23 = #
$ = %24 = $
% = %25 = %
& = %26 = &
' = %27 = '
( = %28 = (
) = %29 = )
* = %2A = *
+ = %2B = +
, = %2C = ,
- = %2D = -
. = %2E = .
/ = %2F = /
0 = %30 = 0
1 = %31 = 1
2 = %32 = 2
3 = %33 = 3
4 = %34 = 4
5 = %35 = 5
6 = %36 = 6
7 = %37 = 7
8 = %38 = 8
9 = %39 = 9
: = %3A = :
; = %3B = ;
< = %3C = <
= = %3D = =
> = %3E = >
? = %3F = ?
@ = %40 = @
A = %41 = A
B = %42 = B
C = %43 = C
D = %44 = D
E = %45 = E
F = %46 = F
G = %47 = G
H = %48 = H
I = %49 = I
J = %4A = J
K = %4B = K
L = %4C = L
M = %4D = M
N = %4E = N
O = %4F = O
P = %50 = P
Q = %51 = Q
R = %52 = R
S = %53 = S
T = %54 = T
U = %55 = U
V = %56 = V
W = %57 = W
X = %58 = X
Y = %59 = Y
Z = %5A = Z
[ = %5B = [
\ = %5C = \
] = %5D = ]
^ = %5E = ^
_ = %5F = _
` = %60 = `
a = %61 = a
b = %62 = b
c = %63 = c
d = %64 = d
e = %65 = e
f = %66 = f
g = %67 = g
h = %68 = h
i = %69 = i
j = %6A = j
k = %6B = k
l = %6C = l
m = %6D = m
n = %6E = n
o = %6F = o
p = %70 = p
q = %71 = q
r = %72 = r
s = %73 = s
t = %74 = t
u = %75 = u
v = %76 = v
w = %77 = w
x = %78 = x
y = %79 = y
z = %7A = z
{ = %7B = {
| = %7C = |
} = %7D = }
~ = %7E = ~
= %7F = 
= %81 = 
= %82 = ‚
= %83 = ƒ
= %84 = „
= %85 = …
= %86 = †
= %87 = ‡
= %88 = ˆ
= %89 = ‰
= %8B = ‹
= %8C = Œ
= %8D = 
= %8E = Ž
= %8F = 
= %90 = 
= %91 = ‘
= %92 = ’
= %93 = “
= %94 = ”
= %95 = •
= %96 = –
= %97 = —
= %98 = ˜
= %99 = ™
= %9A = š
= %9B = ›
= %9C = œ
= %9D = 
= %9E = ž
= %9F = Ÿ
= %A0 =  
! = %A1 = ¡
" = %A2 = ¢
# = %A3 = £
$ = %A4 = ¤
% = %A5 = ¥
& = %A6 = ¦
' = %A7 = §
( = %A8 = ¨
) = %A9 = ©
* = %AA = ª
+ = %AB = «
, = %AC = ¬
- = %AD = ­
. = %AE = ®
/ = %AF = ¯
0 = %B0 = °
1 = %B1 = ±
2 = %B2 = ²
3 = %B3 = ³
4 = %B4 = ´
5 = %B5 = µ
6 = %B6 = ¶
7 = %B7 = ·
8 = %B8 = ¸
9 = %B9 = ¹
: = %BA = º
; = %BB = »
< = %BC = ¼
= = %BD = ½
> = %BE = ¾
? = %BF = ¿
@ = %C0 = À
A = %C1 = Á
B = %C2 = Â
C = %C3 = Ã
D = %C4 = Ä
E = %C5 = Å
F = %C6 = Æ
G = %C7 = Ç
H = %C8 = È
I = %C9 = É
J = %CA = Ê
K = %CB = Ë
L = %CC = Ì
M = %CD = Í
N = %CE = Î
O = %CF = Ï
P = %D0 = Ð
Q = %D1 = Ñ
R = %D2 = Ò
S = %D3 = Ó
T = %D4 = Ô
U = %D5 = Õ
V = %D6 = Ö
W = %D7 = ×
X = %D8 = Ø
Y = %D9 = Ù
Z = %DA = Ú
[ = %DB = Û
\ = %DC = Ü
] = %DD = Ý
^ = %DE = Þ
_ = %DF = ß
` = %E0 = à
a = %E1 = á
b = %E2 = â
c = %E3 = ã
d = %E4 = ä
e = %E5 = å
f = %E6 = æ
g = %E7 = ç
h = %E8 = è
i = %E9 = é
j = %EA = ê
k = %EB = ë
l = %EC = ì
m = %ED = í
n = %EE = î
o = %EF = ï
p = %F0 = ð
q = %F1 = ñ
r = %F2 = ò
s = %F3 = ó
t = %F4 = ô
u = %F5 = õ
v = %F6 = ö
w = %F7 = ÷
x = %F8 = ø
y = %F9 = ù
z = %FA = ú
{ = %FB = û
| = %FC = ü
} = %FD = ý
~ = %FE = þ
= %FF = ÿ
To use the hex, I think you'd have to omit the percent sign (``%'') and
prepend ``\x'', and to do it in octal, you'll have to do the arithmetic,
but I hope this helps, such as it is.
--
Rich Grise
richgrise@entheosengineering.com
(No need to futz with my e-mail: I have a "Delete" button!)
------------------------------
Date: 23 Sep 1998 14:40:15 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Q: Picking an element from a hash (not knowing which!) [Zorn's lemma?]
Message-Id: <6ubfaf$olt$1@monet.op.net>
In article <360921CF.8E95AD2C@min.net>, John Porter <jdporter@min.net> wrote:
>Tad McClellan wrote:
>> push @a, (keys %h)[0] if @a == 0;
>
>@a or @a = ( (each %ENV)[0] );
@a = scalar each %h unless @a;
------------------------------
Date: Wed, 23 Sep 1998 18:00:08 GMT
From: Daniel Grisinger <dgris@rand.dimensional.com>
Subject: Regular Expression Beautifier
Message-Id: <6ubc2r$aat$1@rand.dimensional.com>
I have posted a new version of regdecl to-
ftp://perrin.dimensional.com/pub/perl/regdecl
http://perrin.dimensional.com/perl/regdecl
regdecl is a regular expression beautifier that
accepts a regular expression as input and generates
a formatted, commented, regular expression as output.
For example-
'(?:(?:as?)\t+.+(?:ooga(?!booga)|flim(?=flam)
(walla-walla))((?<!asdf)q*?(?<=t)(?:rv+)*last
(?#this is a comment)asdf{5,93}[q-u](?:\t
\n\r\f+\a?))\basd\Bqq(?is:asdgf))'
becomes
(?: # Start non-capturing group
(?: # Start non-capturing group
a # The literal string `a'
s? # The literal string `s' 0 or 1 time
) # End group
\t+ # tab 1 or more times
.+ # Any character 1 or more times
(?: # Start non-capturing group
ooga # The literal string `ooga'
(?! # Negative lookahead
booga # The literal string `booga'
) # End group
| # Or
flim # The literal string `flim'
(?= # Positive lookahead
flam # The literal string `flam'
) # End group
( # Start capturing group
walla-walla # The literal string `walla-walla'
) # End group
) # End group
( # Start capturing group
(?<! # Negative lookbehind
asdf # The literal string `asdf'
) # End group
q*? # The literal string `q' 0 or more times, non-greedy
(?<= # Positive lookbehind
t # The literal string `t'
) # End group
(?: # Start non-capturing group
r # The literal string `r'
v+ # The literal string `v' 1 or more times
)* # End group 0 or more times
last # The literal string `last'
(?#thisisacomment) # An inline comment? That seems silly!
asd # The literal string `asd'
f{5,93} # The literal string `f' 5 to 93 (inclusive) times
[q-u] # Any of q-u
(?: # Start non-capturing group
\t # tab
\n # newline
\r # carriage return
\f+ # form feed 1 or more times
\a? # alarm 0 or 1 time
) # End group
) # End group
\b # word boundary
asd # The literal string `asd'
\B # non word-boundary
qq # The literal string `qq'
(?is: # Start group, case insensitive, dot matches newline,
asdgf # The literal string `asdgf'
) # End group
) # End group
There are probably still a few bugs, but maybe someone
will find this useful.
dgris
- thanks to Andrew Johnson for helping me shake the
most egregious bugs out :-)
--
Daniel Grisinger dgris@perrin.dimensional.com
`By about halfway through I was beginning to guess the
ending, but it still kind of surprised me.'
David Hatunen, talking about the movie Titanic
------------------------------
Date: Wed, 23 Sep 1998 13:22:18 -0500
From: Rich Grise <richgrise@entheosengineering.com>
To: Steffen Beyer <sb@engelschall.com>
Subject: Re: Simple, efficient way of checking whether $VAR is an element of set @LIST ?
Message-Id: <36093C5A.79D3@entheosengineering.com>
Steffen Beyer wrote:
>
> For heaven's sake, no! :-)
>
> if (exists $hash{$var}) {
> do stuff ;
> }
>
> will just do fine!
>
> Hope this helps.
>
> Steffen Beyer <sb@engelschall.com>
> Free Perl and C Software for Download: www.engelschall.com/u/sb/download/
OK, stupid question number infinity minus 1:
does exists() work on just a plain array?
Or is grep the right answer for that?
as in,
unless ($item [is already in] @array) {
shove, or splice, or put, or whatever gets it in there (it'd be nice
to keep @array sorted during this [and I much prefer the html
perldocs,
but with Linux I have to pod2html every single one by hand, and xman
perl[stuff] really sucks]) (and this one I can and will look up -
in fact, if this question gets snubbed, I'll go spend the next
week or 2 digging this out of all that documentation!)
}
Thanks, and forgive my laziness for asking rather than plowing through
all the real docs.
--
Rich Grise
richgrise@entheosengineering.com
(No need to futz with my e-mail: I have a "Delete" button!)
------------------------------
Date: Wed, 23 Sep 1998 13:14:24 -0500
From: Rich Grise <richgrise@entheosengineering.com>
To: Uri Guttman <uri@camel.fastserv.com>
Subject: Re: Simple, efficient way of checking whether $VAR is an element of set @LIST ?
Message-Id: <36093A80.4C9B@entheosengineering.com>
Uri Guttman wrote:
[...]
> maybe it's just me, but don't we hate it when poor solutions to FAQ's
> are posted. how many out there don't know about exists? raise your
> hands.
>
> Uri Guttman
Here!
--
Rich Grise
richgrise@entheosengineering.com
(No need to futz with my e-mail: I have a "Delete" button!)
------------------------------
Date: Wed, 23 Sep 1998 13:12:42 -0500
From: Rich Grise <richgrise@entheosengineering.com>
To: Douglas Clifton <doug@weboneinc.com>
Subject: Re: Simple, efficient way of checking whether $VAR is an element of set @LIST ?
Message-Id: <36093A1A.2272@entheosengineering.com>
Douglas Clifton wrote:
>
[after some quoted questions, excerpted]
> Because the original poster was looking for a way to check for the existance
> of a variable in the set of *keys* for a hash, not the set of values. Try:
>
> if (grep /^$var$/, keys %hash) {
> do_stuff();
> }
> else {
> print "bloody murder, the other shoe just dropped!\n";
> }
>
> --
> Douglas Clifton
> Unix/C/Perl/CGI/HTML Programmer
> doug@weboneinc.com
Thanks, from someone who read the group before asking my
stupid question "Is there a ``is $item in @array''" -
grep!
How would I have ever found that? How long would it have
taken me of plowing through RTFM's before I stumbled across
that?
(what we need, for perl newbies, and for Linux newbies, is
a "How do I ... " rtfm. Guess writing it is my job, now ;} )
Anyways, thanks for sharing ``grep'' !
--
Rich Grise
richgrise@entheosengineering.com
(No need to futz with my e-mail: I have a "Delete" button!)
------------------------------
Date: Wed, 23 Sep 1998 17:53:53 GMT
From: droby@copyright.com
Subject: Re: where is Date::Parse?
Message-Id: <6ubcjh$to1$1@nnrp1.dejanews.com>
In article <6u95nu$na8$1@mathserv.mps.ohio-state.edu>,
ilya@math.ohio-state.edu (Ilya Zakharevich) wrote:
> [A complimentary Cc of this posting was sent to Abigail
> <abigail@fnx.com>],
> who wrote in article <6u8mme$5n8$2@client3.news.psi.net>:
> > Why? CPAN.pm doesn't go out to a CPAN site and check the version
> > number of a module. It uses the 02packages.details.txt file.
> > So can I. I don't need a module to interpret the line
> > Apache 1.22 DOUGM/mod_perl-1.15.tar.gz
> > for me.
>
> Neither do you need a lynx for HTTP or FTP connection, telnet will
> do. So what?
>
> Ilya
>
For that matter, who needs a newsreader or mail program? Real networkers use
telnet. (Of course I forge my news headers to make you THINK I post from a
browser...)
--
Don Roby
<droby@copyright.com>
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: 12 Jul 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 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
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 3801
**************************************