[9014] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 2633 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon May 18 18:08:27 1998

Date: Mon, 18 May 98 15:01:36 -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           Mon, 18 May 1998     Volume: 8 Number: 2633

Today's topics:
        Pre-ANNOUNCE of a Perl Documentation Navigator (Peter Rowell)
    Re: Pre-ANNOUNCE of a Perl Documentation Navigator <sb@sdm.de>
    Re: Problem with spaces in directory path names in Perl (Tye McQueen)
    Re: Question: Is Perl an acronym? (Wayne C. McCullough)
        readin VT100 data from Perl <rbowen@databeam.com>
    Re: while, each & assoc array (John Moreno)
    Re: while, each & assoc array <Jan@McCann.cz>
        Why do I see the source?? <pohnewein@prodata.it>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: 18 May 1998 13:28:21 -0700
From: thirdeye@sonic.net (Peter Rowell)
Subject: Pre-ANNOUNCE of a Perl Documentation Navigator
Message-Id: <6jq5l5$klu@bolt.sonic.net>

I wasn't going to post this message until I was ready to release
the alpha version of PerlNav, but the amount of "energy" that has
been expended in the recent "Perl IDE" discussion seems to demand
that I let people know what I am doing and when it will be available.


Pre-ANNOUNCE of PerlNav: a Perl Documentation Navigator

PerlNav is a prototype for a documentation manager.  It is the
grandchild of a simple perl script that I have used for years to
find things in the perl documentation.

Rationale:

    o A complex system that is under-documented is worthless.

    o A complex system that is over-documented is almost unheard of! :-)

    o Perl is a complex system that has an amazing amount of documentation
	available - the main docs + FAQ have something on the order of
	30,000 to 45,000 lines, depending on how you count things.  At
	60 lines to the page, this is on the order of 500 to 700+ pages.
	The perl5.004_2 distribution for Win95 includes 164,000 lines
	of HTML docs!  AND this does *not* include anywhere near all of
	the modules at CPAN.

    o Telling someone to Read The Friendly Manual is fine, but
	*finding* things in the FM can be difficult, particularly
	since the manual has no index.

    until now ......


PerlNav has a number of features that make it useful for accessing
documentation.

    o Web-based interface - everybody has a browser, regardless of OS.
    o Runs as a CGI script under an existing web server, OR
    o Includes its own, ready to run miniserver.  Yes, it works with
	the perl5.004_2 binary distribution for Win32.
    o Performs paragraph level searching.  This means it doesn't tell
	you what file the hit was in, but which paragraph.
    o Shows hit lists as keywords-in-context-in-paragraph.
    o Displays documents with search terms highlighted.
    o It's moderately quick.  It is definitely faster than me trying
	to wander through the docs looking for that example I saw
	three months ago and now I need it and where the hell is it?!

PerlNav is:

    o not a build-the-index-first type of system, but its performance
	seems to be acceptable, certainly for single-user systems.
    o not intended to be used on super-large collections of random,
	unrelated files.
    o not done - it is a work-in-progress.  I have several ideas about
	future extensions and I know that users will have all sorts of
	interesting suggestions.


How Do I Get It?

    You can't, yet.  I will be asking for alpha-testers sometime
    before the end of May.  (If you feel that your life is in danger
    in the next two weeks and that this is the only thing that can
    save you, you can send me email at peter@thirdeye.com and I
    *might* answer, but wait until the announcement if you can.)

End of Pre-ANNOUNCEment


The following are just my opinions.  If you are happy with yours,
you can skip the rest of this message!


[ Sounds of climbing up on a soap box ]

I would like to say a few words about "newbie abuse".

I have been dismayed at the intensity of opinion directed at new
users of Perl.  It would seem to me that this is a good place to
apply what your Mom told you - "If you can't say something nice
(or helpful), don't say anything at all".  If nothing else it is
a waste of breath/bandwidth/time (yours, mine, and everyone else's).

Yes, there are many clueless people wandering the halls of c.l.p.m.,
but are they any more clueless than *you* were when you first got
into the fever of programming?  Remember?

And just because you have been programming for 25 years, have used
30+ languages on 60+ different platforms, and written a gazillion
lines of code for OSes, apps, drivers, etc. - even with all of that
you are *still* a newbie yourself (at some level) when you approach
a new language or a new environment.  You are just more experienced
at *being* a newbie than a new newbie is (does that make sense?).

When I first started selling CDB (a C debugger I wrote in the early
1980's), I remember the 'old guys' standing in the back of the room
during the demo saying:

    "adb (an ancient assembly-level debugger) was good enough for
    me and any one who needs one of these newfangled, source-level
    debuggers that do structure dumps and show you the code should
    not be allowed near a keyboard.  etc. etc. (harumph, harumph)"

Well, that was crap then and it is still crap.  Any tool that can
make programming easier for *someone* has some value.  If you don't
want to use it, don't.  If you think there is a better tool available,
say so.  But don't attack someone just because they are new and
clueless - so is a day-old baby, but many of them grow into real
human beings.

Here are my own contributions to the FAQ.

Q:  Is Perl a good language to learn programming in?
A1: Yes, it's cheap, well documented, runs on everything, and is
    the basis for much of the dynamic content of web sites.
A2: Yes, but start slowly, using the features one-at-a-time until
    you understand what they do.
A3: Yes, but don't ask any questions on c.l.p.m :-)
A4: No, but don't ask me to name a better one.
A5: No. I once heard that Pascal was like the round-nosed scissors
    you had in grade shool and that C was like a two-edge razor
    (you could do a lot, but you could also bleed to death on the
    machine room floor).  I would like to extend this by saying
    that Perl *looks* like the round-nosed scissors, but is actually
    a multi-dimensional laser beam.  ("Fenster!  Don't run with that
    laser beam, you'll delete someone's directory!")

Q:  How does a newbie get started?
A1: Buy lots of O'Reilly books and read them cover-to-cover.
A2: Look at the source of modules written by the tribal elders.
A3: Just do it!  Programming is a state of mind and the only way
    to get there is to be there.  I know that sounds a bit Zen
    or something, but if you don't make an effort to figure out
    your own problems/bugs, you will never develop the mental tools
    you need to BE a programmer.
A4: But don't do it in CGI!  I think many of the problems that are
    posted to c.l.p.m are related to the mind twist you need in
    order to understand that the CGI script is being run as the
    *server's* user, not as you.  This has many subtle (and not so
    subtle) implications in terms of working directories, environment,
    permissions, etc.  Debugging can be difficult enough when
    everything is in the same directory.  Debugging through a
    [browser->network->web server->CGI script] combination can be a
    bitch!  I have developed a raft of tools for simulating my CGI
    environment just so I *don't* have to debug in that tar pit!
    But is a newbie going to know that they just decided to learn
    to rock climb on a (potentially) Class 6 ascent?  I think not.

Q:  So what do you do when the 1,000th newbie asks the same question?
A1: Well, by now it sure as hell should be in the FAQ!
A2: Don't say anything.  Let someone else yell at them and say RTFM! :-) 
A3: Realize that it is probably *the newbie's* first time asking
    that question.  This is different from someone asking the
    same question 1,000 times, true?

Q:  But they don't *read* the F****** FAQ!
A:  Perhaps they need a little help finding things. (see above)

Q:  Newbies drive me crazy!  What can I do?
A1: Ignore them.
A2: Stop reading the newsgroup.
A3: Only read postings by people you know are not newbies.
A4: Create a filter (in perl) for the newsgroup that eliminates all
    posts containing questions that have an 80+% conceptual similarity
    to items in the FAQ.  Share it with others!

Q:  They want us to do their homework!
A:  Well, to hell with them! (you gotta flame *something*! :-)

[ Sounds of falling off soap box ]

    Peace,

    Peter Rowell
    Third Eye Software
    peter@thirdeye.com



------------------------------

Date: 18 May 1998 20:55:47 GMT
From: Steffen Beyer <sb@sdm.de>
Subject: Re: Pre-ANNOUNCE of a Perl Documentation Navigator
Message-Id: <6jq78j$c4l$1@bsdti6.sdm.de>

[mailed && posted]

In article <6jq5l5$klu@bolt.sonic.net>,
Peter Rowell <thirdeye@sonic.net> wrote:

> [...]

>     o Telling someone to Read The Friendly Manual is fine, but
> 	*finding* things in the FM can be difficult, particularly
> 	since the manual has no index.

>     until now ......

> PerlNav has a number of features that make it useful for accessing
> documentation.

>     o Web-based interface - everybody has a browser, regardless of OS.
>     o Runs as a CGI script under an existing web server, OR
>     o Includes its own, ready to run miniserver.  Yes, it works with
> 	the perl5.004_2 binary distribution for Win32.
>     o Performs paragraph level searching.  This means it doesn't tell
> 	you what file the hit was in, but which paragraph.
>     o Shows hit lists as keywords-in-context-in-paragraph.
>     o Displays documents with search terms highlighted.
>     o It's moderately quick.  It is definitely faster than me trying
> 	to wander through the docs looking for that example I saw
> 	three months ago and now I need it and where the hell is it?!

> PerlNav is:

>     o not a build-the-index-first type of system, but its performance
> 	seems to be acceptable, certainly for single-user systems.
>     o not intended to be used on super-large collections of random,
> 	unrelated files.
>     o not done - it is a work-in-progress.  I have several ideas about
> 	future extensions and I know that users will have all sorts of
> 	interesting suggestions.

Sounds like a really *GREAT* tool!

I want a copy as soon as it'll be available! :-)

I also volunteer for alpha and beta testing.

> The following are just my opinions.  If you are happy with yours,
> you can skip the rest of this message!

> I would like to say a few words about "newbie abuse".

> I have been dismayed at the intensity of opinion directed at new
> users of Perl.  It would seem to me that this is a good place to
> apply what your Mom told you - "If you can't say something nice
> (or helpful), don't say anything at all".  If nothing else it is
> a waste of breath/bandwidth/time (yours, mine, and everyone else's).

> Yes, there are many clueless people wandering the halls of c.l.p.m.,
> but are they any more clueless than *you* were when you first got
> into the fever of programming?  Remember?

> And just because you have been programming for 25 years, have used
> 30+ languages on 60+ different platforms, and written a gazillion
> lines of code for OSes, apps, drivers, etc. - even with all of that
> you are *still* a newbie yourself (at some level) when you approach
> a new language or a new environment.  You are just more experienced
> at *being* a newbie than a new newbie is (does that make sense?).

Yes, a lot!

Great statement, which I fully agree with!

> [...]

Yours sincerely,
-- 
    Steffen Beyer <sb@engelschall.com>
    Free Perl and C Software for Download: www.engelschall.com/u/sb/download/
    "Perl is like sex: If you never had it, you wonder what the fuss is all
     about. Once you had it, you never want to be without it again." (unknown)


------------------------------

Date: 18 May 1998 15:04:36 -0500
From: tye@fohnix.metronet.com (Tye McQueen)
Subject: Re: Problem with spaces in directory path names in Perl on WIN32
Message-Id: <6jq48k$rp3@fohnix.metronet.com>

) Jan Krynicky wrote in message <355D0BF4.2595@McCann.cz>...
) >BTW, unless strictly necessary never install anything into a
) >directory with a space in it's name. It's pretty annoying to
) >have to enclose everything into quotes.

"Larry Rosler" <lr@hpl.hp.com> writes:
) These problems are caused by the command interpreter splitting the
) string at the space.

No.  No DOS-based command interpretor splits any command lines
anywhere (other than for it "internal" commands).  And that is a
big part of the problem.  If the command interpretor (or anything)
provided a standard method for interpreting quoted arguments then
we'd have most of a solution for allowing spaces in file names.

Another big part of the problem is that the C standard of passing
a list of arguments to another command is implemented in DOS-based
systems by concatenating the list of arguments together separated
by spaces and letting the other program decide how to reparse the
command line its own way.  Very stupid!

A third smaller part of the problem is the semi-standard method
for allowing spaces in file names that is followed by many but not
all programs coming from Microsoft is too simplistic to deal with
more complex command-line problems.

These combine to prove that command lines will continue to be a
real pain to deal with in the foreseeable future of DOS-based
operating systems.
-- 
Tye McQueen    Nothing is obvious unless you are overlooking something
         http://www.metronet.com/~tye/ (scripts, links, nothing fancy)


------------------------------

Date: 18 May 1998 21:10:29 GMT
From: wayne@Glue.umd.edu (Wayne C. McCullough)
Subject: Re: Question: Is Perl an acronym?
Message-Id: <6jq845$7vq$3@hecate.umd.edu>

Lloyd Zusman (ljz@asfast.com) wrote:
: And to the best of my knowledge, the "Practical Extraction and
: Reporting Language" acronym was *not* the first one back-fitted by
: Larry Wall.  As early as 1988, I recall seeing his mention of another,
: possibly more appropriate acronym in the Perl man pages.

Yes, but he told you (in the man page) not to tell anyone he said that.

W


------------------------------

Date: Mon, 18 May 1998 16:28:19 -0400
From: Rich Bowen <rbowen@databeam.com>
Subject: readin VT100 data from Perl
Message-Id: <356099E3.3AB2@databeam.com>

Just wondering if there is a Perl module out there that will read data
from a VT100 terminal session?

TIA
Rich
-- 
##################################################
#  Rich Bowen                                    #
#  Web Services Engineer - DataBeam Corporation  #
#  rbowen@databeam.com                           #
##################################################


------------------------------

Date: Mon, 18 May 1998 20:22:08 GMT
From: phenix@interpath.com (John Moreno)
Subject: Re: while, each & assoc array
Message-Id: <1d98dny.1k66say14kdvikN@roxboro0-013.dyn.interpath.net>

Randal Schwartz <merlyn@stonehenge.com> wrote:

> >>>>> "John" == John Moreno <phenix@interpath.com> writes:
> 
> John> Yeah, I don't know who should be given the credit for it, but perls
> John> alternative for the single statement  (statement condition;) is much
> John> better.
> 
> There's no such thing.  It's "expression condition;" You cannot tack a
> condition onto an arbitrary statement.
>
> If you read that in a book, please tell me the book, so I can laugh
> at it properly. :-)

Well, I knew what I meant and so did you, and I ain't writing
documentation or specs so it seems close enough to me. Of course if you
put it in one of your books or classes somebody would be bound to laugh
at it (and of course in those circumstances they'd probably be right).

-- 
John Moreno


------------------------------

Date: Mon, 18 May 1998 23:01:18 -0700
From: Jan Krynicky <Jan@McCann.cz>
Subject: Re: while, each & assoc array
Message-Id: <3561202E.42F5@McCann.cz>

David A. Lyons wrote:
> 
> Tom Christiansen wrote:
> >
> >  [courtesy cc of this posting sent to cited author via email]
> >
> > In comp.lang.perl.misc, lyonsd@atl.hp.com writes:
> > :I'm stumped.
> >
> > That's because you didn't use -w, and have really lame indentation.
> 
> Why's that?
> 
> *This* is sloppy and difficult to read:
> 
> function {
>         block of code;
> }
> 
> This is neat and easy to read and keep track of braces:
> 
> function
>         {
>         block of code;
>         }
> 
> It makes a big difference when you start getting into a lot of nested
> blocks.
> 
> Dave

What about

function
{
    block;
    of code;
}

:-)

FYI: I like this, but I usualy tend to use the usual
fun {
   block
}

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 ;-)

Jenda


------------------------------

Date: Mon, 18 May 1998 20:59:32 +0200
From: Patrick Ohnewein <pohnewein@prodata.it>
Subject: Why do I see the source??
Message-Id: <35608514.C75B52AE@prodata.it>

I am new in perl, I am trying now the whole day to get something work!

I downloaded the standard perl for NT (I have to use this in my office)
from CPAN.
I wrote a simple program:

#!/usr/local/bin/perl -w
# howdy
print "Content-type: text/html\n\n";
print "<HTML><HEAD><TITLE>Hello World</TITLE></HEAD><BODY><H1>Greetings,
Terrans!</H1></BODY></HTML>\n";

I executed
perl howdy
from the command line
it puts out the HTML source.

I putted the file, that I named howdy on my cgi-bin directory

But when I direct my WEB-Browser (Netscape Communicator 4.02)
to that location
 .../cgi-bin/howdy
I don't see the HTML-Page that the script should transmit, but I see the
scrip source.

Could be I am a fool, but I cannot get it work.
I'm reading O'Reillys "Learning Perl", but there is not explained, or I
didn't find what I have to do.
I also set the chmod to read, write, exec for Owner, Group and User(the
latter not write).

Can anybody explain me where is the mistake?

P@trick

--
-----------------------------------------------------
Save software competition, use Linux and Java!
mailto:pohnewein@prodata.it




------------------------------

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 2633
**************************************

home help back first fref pref prev next nref lref last post