[8968] in Perl-Users-Digest
Perl-Users Digest, Issue: 2586 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed May 13 17:10:28 1998
Date: Wed, 13 May 98 14:01:48 -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, 13 May 1998 Volume: 8 Number: 2586
Today's topics:
Re: Perl for Non-programmers (was Re: Does Perl have a <tchrist@mox.perl.com>
Re: Perl for Non-programmers (was Re: Does Perl have a (John Porter)
Re: Perl for Non-programmers <rra@stanford.edu>
Re: Question: Finding which element of a list a string nick@hob.com
Re: Readdir & upper/lower case <jdf@pobox.com>
Re: Readdir & upper/lower case (I R A Aggie)
Re: Really Basic Questions (Craig Berry)
Re: Really Basic Questions (Paul Hounshell)
Re: Really Basic Questions <tchrist@mox.perl.com>
resolving IP addresses on WinNT <mwallace@abelsolutions.com>
run against a list <downs.bj.1@pg.com>
Re: Significant digit? <rra@stanford.edu>
Re: Significant digit? (brian d foy)
Re: Significant digit? (Craig Berry)
Re: Significant digit? (Greg Bacon)
Re: Tip: Greedy Or <tchrist@mox.perl.com>
Re: Tip: Greedy Or (Ilya Zakharevich)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 13 May 1998 19:56:41 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Perl for Non-programmers (was Re: Does Perl have a IDE?I don't like command line.
Message-Id: <6jcttp$c3k$3@csnews.cs.colorado.edu>
In comp.lang.perl.misc,
Birgitt Funk <birgitt@order.booktraders.com> writes:
:Can I conclude you would not agree with Aggie and Allbery
:then and that you think, given the 'right' way of teaching,
:Perl could be used to learn and develop the algorithmic
:mentality for beginning programming students?
Yes, although it's its dwimmer dweomer that's important
here. Other languages also qualify. Kill memory management,
anal retention, and strong typing.
:If your answer would be yes, do you think it's already taught
:somewhere the 'right' way ?
I don't know that. I don't try to teach it as a first language,
although I know people for whom it was indeed such.
--tom
--
If I allowed "next $label" then I'd also have to allow "goto $label",
and I don't think you really want that... :-) [now works in perl5!]
--Larry Wall in <1991Mar11.230002.27271@jpl-devvax.jpl.nasa.gov>
------------------------------
Date: Wed, 13 May 1998 20:41:06 GMT
From: jdporter@min.net (John Porter)
Subject: Re: Perl for Non-programmers (was Re: Does Perl have a IDE?I don't like command line.
Message-Id: <MPG.fc3d10d4c09366f9896ba@news.min.net>
On 13 May 1998 19:56:41 GMT,
in article <6jcttp$c3k$3@csnews.cs.colorado.edu>,
tchrist@mox.perl.com (Tom Christiansen) wrote:
>
> Kill memory management,
> anal retention, and strong typing.
Hmm. I think we need memory management.
I'm glad Perl does it for me. ;-)
I think Perl is a strongly typed language;
depends on what one means by type.
DB<1> $a = []
DB<2> print $$a
Not a SCALAR reference at (eval 5) line 2, <IN> chunk 2.
That's not weak, in my estimation.
John Porter
------------------------------
Date: 13 May 1998 13:07:59 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: Perl for Non-programmers
Message-Id: <m31ztyq6hs.fsf_-_@windlord.Stanford.EDU>
Tom Christiansen <tchrist@mox.perl.com> writes:
> Birgitt Funk <birgitt@order.booktraders.com> writes:
>> Can I conclude you would not agree with Aggie and Allbery then and that
>> you think, given the 'right' way of teaching, Perl could be used to
>> learn and develop the algorithmic mentality for beginning programming
>> students?
> Yes, although it's its dwimmer dweomer that's important here. Other
> languages also qualify. Kill memory management, anal retention, and
> strong typing.
Am I the only person who thinks that strong typing is a useful language
feature for a new programmer? I'm glad I'm *aware* of typing issues even
while I'm writing Perl; I can both appreciate the freedom of Perl's
approach and catch subtle things like interaction with use integer or how
to use pack/unpack. Both of those features of Perl are much harder to
understand without the background of a strongly typed language, IMO.
--
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
------------------------------
Date: Wed, 13 May 1998 20:18:31 GMT
From: nick@hob.com
Subject: Re: Question: Finding which element of a list a string corilates to
Message-Id: <6jcv6n$698$1@nnrp1.dejanews.com>
My question was answered earlier. Unfortunatley the examples in the PERL faq
do not apply to this case. They are checking to see if an element exists I
need to determain what position the element holds in the array.
In article <6jc3jr$brn@Jupiter.Mcs.Net>,
jima@MCS.COM (Jim Allenspach) wrote:
>
> nick@hob.com writes:
>
> >I'm trying to find out what position a given string holds in a list
>
> You might check the Perl FAQ (http://language.perl.com/faq/). It
> has an answer to this very question (look in perlfaq4 for the question "How
> can I tell whether an array contains a certain element?"). Hope this helps.
>
> jma
>
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: 13 May 1998 16:39:26 -0500
From: Jonathan Feinberg <jdf@pobox.com>
To: samdie@mail.vei.net
Subject: Re: Readdir & upper/lower case
Message-Id: <n2clyho1.fsf@mailhost.panix.com>
samdie@mail.vei.net writes:
> Don't see any references to case conversion for readdir in either the
> camel book or the on-line docs.
As far as I can tell from glancing at the sources, the readdir builtin
delegates most of its work to the standard library readdir() function,
documented on unix boxes in the manpages. Look to the C libs.
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf/
------------------------------
Date: Wed, 13 May 1998 16:39:05 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Readdir & upper/lower case
Message-Id: <fl_aggie-1305981639050001@aggie.coaps.fsu.edu>
In article <3559e189$1$fnzqvr$mr2ice@news2.vei.net>, samdie@mail.vei.net wrote:
+ Just noticed something weird (IMO) about readdir.
Nope. readdir is just returning to you what it found out from the device
drivers.
+ I have a *very* simple little script to list (using readdir) all the
+ directories on a drive. I works fine on my HDs (which happen to have mixed
+ case directory names) but on my CDs everything comes out in *lowercase*.
+ Since they're ISO-9660 CDs everything should be *uppercase* (and is
+ reported as so being by the OS [Warp4]).
Agreed: everything on a full-blown ISO-9660 CD is supposed to be 8.3,
all uppper case, no '-' characters, yadda yadda yadda. And yet, you mount
it on your *nix box, and there they are, lower case names.
It is the fault of the CD-ROM drivers. They switch everything to lower
case. I found this out the hard way, after making a hypertext-navagible
CD-ROM and used the ALL UPPER CASE BLESSED filenames in the hyperlinks,
having them work wonderfully on Macs and PC's, only to fail miserably on
the unix side of things.
James
--
Consulting Minister for Consultants, DNRC
The Bill of Rights is paid in Responsibilities - Jean McGuire
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/CPAN-local/doc/FAQs/cgi/idiots-guide.html>
------------------------------
Date: 13 May 1998 19:09:46 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Really Basic Questions
Message-Id: <6jcr5q$5g6$1@marina.cinenet.net>
Paul Hounshell (phounsh@ucdavis.edu) wrote:
: I have an excellent Perl book (from what I can tell) but it leaves out
: a couple of fundamental things. I just need to know what the "not
: equal" comparison operator is, as well as binary And, Or, Not, XOr,
: NAND, and NOr. Thank you,
Not including this information is incompatible with "excellent Perl book."
'perldoc perlop' will give you what you need, as will the Llama or Camel
books, both of which are *really* excellent (I'd go so far as to say
'vital') Perl books.
---------------------------------------------------------------------
| 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: Wed, 13 May 1998 19:05:30 GMT
From: phounsh@ucdavis.edu (Paul Hounshell)
Subject: Re: Really Basic Questions
Message-Id: <3559eef0.180089808@news.ucdavis.edu>
Pleasae note, the reason I said excellent book was due to a number of
references by friends as well as the style. Chapters build on each
other, there's a minimum of forward referencing, and everything is
demostrated with examples both in the book and in code. I find
learning a lot easier when the information is presented interactively
as opposed to cut, dry facts. Unfortunately, I have neither the time
nor the patience to sit down and read the book straight through, which
is why I was unabled to find the info. Thank you for your concern
though.
-Paul Hounshell
phounsh@ucdavis.edu
The title of the book is Perl by Example by Ellie Quigley
On 13 May 1998 19:09:46 GMT, cberry@cinenet.net (Craig Berry) wrote:
>Paul Hounshell (phounsh@ucdavis.edu) wrote:
>: I have an excellent Perl book (from what I can tell) but it leaves out
>: a couple of fundamental things. I just need to know what the "not
>: equal" comparison operator is, as well as binary And, Or, Not, XOr,
>: NAND, and NOr. Thank you,
>
>Not including this information is incompatible with "excellent Perl book."
>'perldoc perlop' will give you what you need, as will the Llama or Camel
>books, both of which are *really* excellent (I'd go so far as to say
>'vital') Perl books.
>
>---------------------------------------------------------------------
> | 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: 13 May 1998 20:10:29 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Really Basic Questions
Message-Id: <6jcunl$c3k$8@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, phounsh@ucdavis.edu (Paul Hounshell) writes:
:The title of the book is Perl by Example by Ellie Quigley
Oh my.
--tom
--
/* 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: Wed, 13 May 1998 15:35:29 -0400
From: michal <mwallace@abelsolutions.com>
Subject: resolving IP addresses on WinNT
Message-Id: <3559F601.38E38B6D@abelsolutions.com>
hey all,
here's a fun little routine to resolve ip addresses on an
NT system...
now that I've gone and done it, can someone tell me where
I should have looked to begin with? :)
- michal
sub resolve {
$ipaddress = shift;
open LOOKUP, "ping -a $ipaddress -n 1|";
while (<LOOKUP>) { /Pinging (.*) (\[.*\]) / && print "$1 = $2" };
close LOOKUP;
$1;
}
------------------------------
Date: Wed, 13 May 1998 15:10:09 -0400
From: "Bruce J. Downs" <downs.bj.1@pg.com>
Subject: run against a list
Message-Id: <3559F011.DAF@pg.com>
I have a perl program that I submit on my NT server and the script comes
back with info about the server I submitted on. What I want to do is
submit the script, the script runs against a list of servers, on the
network, that I have in a file somewhere else. A file that I can edit
when needed, without touching the perl script. Is their a way to do
this? Thanks in advance.
------------------------------
Date: 13 May 1998 11:53:23 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: Significant digit?
Message-Id: <m3ra1yq9y4.fsf@windlord.Stanford.EDU>
Not quite right in the last post....
Russ Allbery <rra@stanford.edu> writes:
> Um, no. Trailing zeroes are only considered significant if they occur to
> the right of the decimal place.
No, that's not quite accurate. Trailing zeroes are only considered
significant if there are zeroes to the right of the decimal place in the
number. (So 1200.0 has five significant digits.) I've never seen the
1200. notation, probably because in general scientific notation is used
instead.
--
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
------------------------------
Date: Wed, 13 May 1998 15:33:17 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: Significant digit?
Message-Id: <comdog-ya02408000R1305981533170001@news.panix.com>
Keywords: from just another new york perl hacker
In article <m3ra1yq9y4.fsf@windlord.Stanford.EDU>, Russ Allbery <rra@stanford.edu> posted:
>Russ Allbery <rra@stanford.edu> writes:
>
>> Um, no. Trailing zeroes are only considered significant if they occur to
>> the right of the decimal place.
>
>No, that's not quite accurate. Trailing zeroes are only considered
>significant if there are zeroes to the right of the decimal place in the
>number. (So 1200.0 has five significant digits.) I've never seen the
>1200. notation, probably because in general scientific notation is used
>instead.
the pedantic point of something like 1200. usually is a behind the scenes
sort of thing - such as writing a number in a lab book or such. for
instance, if i've been keeping a column of numbers like
1234
4567
3456
which have 4 significant figures, then get a reading of the same precision
but is
1200
i add the decimal to make it
1200.
to show that those zeroes are significant. how numbers are reported in the
literature is a different story.
however, should we choose to write a routine that reports numbers with
significant digits, but not in scientific notation, it's a point to
remember. it would be nice to have a module or some such to do
scientific notation, since we've already seen that the "e" notation
from the printf family doesn't do it.
--
brian d foy <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers <URL:http://www.pm.org>
------------------------------
Date: 13 May 1998 19:45:28 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Significant digit?
Message-Id: <6jct8o$5g6$2@marina.cinenet.net>
John Stanley (stanley@skyking.OCE.ORST.EDU) wrote:
: In article <6jbg65$jo8$3@marina.cinenet.net>,
: Craig Berry <cberry@cinenet.net> wrote:
: >John Stanley (stanley@skyking.OCE.ORST.EDU) wrote:
: >: In article <6jalpa$pei$2@client2.news.psi.net>,
: >: 1200 has 2 significant digits. 1200. has 4.
: >
: >It's actually impossible to say how many either has a priori, though the
: >latter does more strongly suggest 4.
:
: No, it is not impossible. It is quite possible. 1200. has 4 significant
: figures. That is why the decimal point is there. The only meaning to the
: decimai point in 1200. is to give significance to the zeros.
This may be a cultural issue; I come from a science background, but I
wouldn't be *certain* that 1200. had four sig figs, despite the use of an
explicit decimal. I'd guess that was the case, but this convention was
never made 'official' during my education. I was always taught that to
express an explicit precision, one should use exponential notation, or an
explicit error estimate (1200 +- 50), or preferably (for formal work)
both.
---------------------------------------------------------------------
| 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: 13 May 1998 20:41:20 GMT
From: gbacon@cs.uah.edu (Greg Bacon)
Subject: Re: Significant digit?
Message-Id: <6jd0hg$go7$1@info.uah.edu>
In article <6jct8o$5g6$2@marina.cinenet.net>,
cberry@cinenet.net (Craig Berry) writes:
: I come from a science background, but I
: wouldn't be *certain* that 1200. had four sig figs, despite the use of an
: explicit decimal.
I've even seen a horizontal bar above significant zeros. Of course,
that's difficult to represent aesthetically with ASCII, which is why,
IMHO, scientific notation would be a better choice in a textual medium.
Imagine learning so much in high school chemistry. :-)
Greg
--
open(G,"|gzip -dc");$_=<<EOF;s/[0-9a-f]+/print G pack("h*",$&)/eg
f1b88000b620f22320303fa2d2e21584ccbcf29c84d2258084
d2ac158c84c4ece4d22d1000118a8d5491000000
EOF
------------------------------
Date: 13 May 1998 20:08:07 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Tip: Greedy Or
Message-Id: <6jcuj7$c3k$7@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
Nathan Torkington <gnat@frii.com> writes:
:The heart of the nugget is that regexp alternatives separated by | in
:Perl are temporally greedy rather than textually greedy.
And in fact, everything in Perl is no more than temporarily greedy,
even star and plus and hook and brace. It's a traditional NFA.
This effect is not limited to alternation.
--tom
--
"Of course, someone who knows more about this will correct me if I'm wrong,
and someone who knows less will correct me if I'm right."
--David Palmer (palmer@tybalt.caltech.edu)
------------------------------
Date: 13 May 1998 20:56:56 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Tip: Greedy Or
Message-Id: <6jd1eo$5fq$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Tom Christiansen
<tchrist@mox.perl.com>],
who wrote in article <6jcuj7$c3k$7@csnews.cs.colorado.edu>:
> Nathan Torkington <gnat@frii.com> writes:
> :The heart of the nugget is that regexp alternatives separated by | in
> :Perl are temporally greedy rather than textually greedy.
>
> And in fact, everything in Perl is no more than temporarily greedy,
> even star and plus and hook and brace. It's a traditional NFA.
> This effect is not limited to alternation.
We need to put that Larry's quote about "POSIX had choosen the most
pessimal and most rarely needed way to do things as their choice of
arms" into the DOCs somewhere. I do not remember the exact quote.
Ilya
------------------------------
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 2586
**************************************