[15463] in Perl-Users-Digest
Perl-Users Digest, Issue: 2873 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Apr 26 18:16:36 2000
Date: Wed, 26 Apr 2000 15:15:26 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <956787325-v9-i2873@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Wed, 26 Apr 2000 Volume: 9 Number: 2873
Today's topics:
Re: strict <godzilla@stomp.stomp.tokyo>
Re: strict <andrew.mcguire@walgreens.com>
Re: strict <lr@hpl.hp.com>
system commands failing on Windows NT <dstiff@delanotech.com>
Re: system commands failing on Windows NT <makarand_kulkarni@My-Deja.com>
Re: system commands failing on Windows NT <lauren_smith13@hotmail.com>
Re: system commands failing on Windows NT <cradley@nai.com>
Re: system commands failing on Windows NT <lauren_smith13@hotmail.com>
Re: system commands failing on Windows NT <lr@hpl.hp.com>
Re: to print a flat data file with a certain lengths ? <lr@hpl.hp.com>
Re: trying to access elements of a scalar variable (Craig Berry)
Re: trying to access elements of a scalar variable (Craig Berry)
Re: trying to access elements of a scalar variable <matst90@katz.pitt.edu>
Re: trying to access elements of a scalar variable <rootbeer@redcat.com>
Re: trying to access elements of a scalar variable <lauren_smith13@hotmail.com>
Re: trying to access elements of a scalar variable <sariq@texas.net>
Re: trying to access elements of a scalar variable <lauren_smith13@hotmail.com>
Re: trying to access elements of a scalar variable (Tad McClellan)
Which modules are loaded on my server? <ewald@electronicfrontiers.com>
Re: Which modules are loaded on my server? <rootbeer@redcat.com>
Re: Win98 Pipe problem <Jonathan.L.Ericson@jpl.nasa.gov>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 26 Apr 2000 12:41:41 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: strict
Message-Id: <39074675.59E1BA42@stomp.stomp.tokyo>
Penpal International wrote:
> I'm already programming in perl for quite a while (1.5 years). But I
> still have no idea what this exactly does: "use strict" Can someone
> explain the use of it?
> Frank de Bot
Laughs... cute. Don't be offended. Such
an appropriate name considering some of
the antics which take place in news groups.
Many behave as 'bots' or common robots by
reciting and chanting,
perldoc perlop perlfaq
If we could hear their voices, I am quite
certain these people would talk and sound
just like the robot (Robby) from the rather
Gilligan's Island style "Lost In Space."
==
"This is the safest mode to operate in, but is
sometimes too strict for casual programming."
http://search.cpan.org/doc/GSAR/perl-5.6.0/lib/strict.pm
Using strict is liken to using strict rules
of grammar in language. Works fine for new
learners, works fine where discipline is a
must but fails miserably for practical use.
You will recall an English teacher along your
way in life who annoyed you with red lines
all over your essays, red lined commas, red
lined clichés, red lined awkwardness, so many
red lines, your creativity is stiffled. Using
strict in Perl is much like this.
Creativity in language, both spoken and in written
languages such as Perl, comes with learning and
direct experience. Use of strict is very effective
as a teaching tool until you no longer need it.
There are some general guidelines about strict
which seem to never be mentioned, as is the case
with almost all pragma hints. One of these little
mentioned guidelines is if you don't have command
line screen access, using pragma hints such as
strict, is a disaster. Without command line access
such as root or telnet, you will never see these
pragma hints unless you make special arrangements
in your script to have them printed. If you have
such a skill to make these special arrangements,
you have no need for pragma hints, yes?
Why this is a disaster is simple. Without command
line access, pragma hints, warnings, will halt
your program and, you never know why. A person
fairly new at this just might assume a problem
with his or her script when all along it is
pragma hints 'crashing' your script. Quite an
oxymoron these pragma hints under some conditions.
Returning to use of strict, another guideline is
this should only be used for large scripts or
scripts which are very complicated, types of
scripts where you do need help in analysis of
whatever problems, assuming command line access
or special arrangements to read pragma hints.
Otherwise, strict and other pragma hints are
useless and often create problems.
For everyday usage, for average scripts we read
floating about here within our internet, pragma
hints are an exercise in futility and an annoying
exercise in frustration if you are unable to
read these pragma hints. Additionally, many of
these 'hints' created are worded in such a way
as to add more confusion and frustration. In some
circumstances, pragma hints are simply dead wrong.
This is yet another classic oxymoron with strict
and other pragma hints.
These obvious oxymorons, not having command line
access and the wording of hints are two fold. Lacking
command line access is an obvious one. However, this
other oxymoron is pragma hints are worded in such
a way, you need to be an expert to make sense of
what you are reading on your screen. Obviously,
many times, pragma hints are directed at experts
rather than those intended to help, beginners.
Pragma hints are intended to help, but often help
only those who don't need help; experts in Perl.
This is a laughable oxymoron.
Pragma hints have a use, a purpose, but should
be used wisely and with some skepticism. For
beginners, the moderately skilled in Perl, I would
say avoid pragma hints like the Black Plague. They
usually are of no benefit and often create problems.
This is a matter for personal judgement and choice.
Those new to Perl, those developing moderate skills
in Perl, will learn infinitely more by figuring out
their problems on their own, sans pragma hints. Hard
lessons; the best learned and best remembered lessons.
If you are the type who needs an English teacher,
ruler in hand, posed and ready to rap your knuckles
for leaving out a comma, then use strict. If you
are the type who doesn't shy away from challenging
circumstances, a type who enjoys learning how to
avoid problems and enjoys hard work, you will find
use of strict to be a lazy programmer's excuse
for avoiding challenges in programming.
Godzilla!
------------------------------
Date: Wed, 26 Apr 2000 15:46:29 -0500
From: "Andrew N. McGuire" <andrew.mcguire@walgreens.com>
Subject: Re: strict
Message-Id: <390755A4.E1954162@walgreens.com>
"Godzilla!" wrote:
>
> Penpal International wrote:
>
> > I'm already programming in perl for quite a while (1.5 years). But I
> > still have no idea what this exactly does: "use strict" Can someone
> > explain the use of it?
>
> > Frank de Bot
>
> Laughs... cute. Don't be offended. Such
> an appropriate name considering some of
> the antics which take place in news groups.
> Many behave as 'bots' or common robots by
> reciting and chanting,
>
> perldoc perlop perlfaq
Which is good... A person need not know everything,
but they should know where to find the answers to their
questions. Many newbies do now know that there is a
plethora of documentation on their own hard drive.
> If we could hear their voices, I am quite
> certain these people would talk and sound
> just like the robot (Robby) from the rather
> Gilligan's Island style "Lost In Space."
Cute, but I speak more like HAL.
[ snip ]
> "This is the safest mode to operate in, but is
> sometimes too strict for casual programming."
If you want "casual" quality code, fine.
>
> http://search.cpan.org/doc/GSAR/perl-5.6.0/lib/strict.pm
"strict - Perl pragma to restrict unsafe constructs"
Sounds like a good thing to me. Safety is paramount. :-)
Also you can get the same information by:
perldoc strict
> Using strict is liken to using strict rules
> of grammar in language. Works fine for new
> learners, works fine where discipline is a
> must but fails miserably for practical use.
There is seldom harm in using strict rules of grammar
when either writing or speaking, so the analogy fails.
> You will recall an English teacher along your
> way in life who annoyed you with red lines
> all over your essays, red lined commas, red
> lined clichés, red lined awkwardness, so many
> red lines, your creativity is stiffled. Using
> strict in Perl is much like this.
You will also recall that the purpose of that teachers
markings were to better your use of the language...
Same with 'use strict'.
> Creativity in language, both spoken and in written
> languages such as Perl, comes with learning and
> direct experience. Use of strict is very effective
> as a teaching tool until you no longer need it.
No. It is a great boon to writing good code in Perl.
Why would you ever want to leave it? I suppose you
should not use '-w' either, right? ;^)
[ snip ]
> Why this is a disaster is simple. Without command
> line access, pragma hints, warnings, will halt
> your program and, you never know why. A person
> fairly new at this just might assume a problem
> with his or her script when all along it is
> pragma hints 'crashing' your script. Quite an
> oxymoron these pragma hints under some conditions.
As is true for Perl, C, and many other languages, compiled or
otherwise. ALWAYS TREAT WARNINGS AS IF THEY WERE ERRORS.
The ideal program exhibits no undefined behaviour. Declaring
variables, and making sure that they contain the values
that they should are a great help. 'use strict' enforces
declaration, as well as other helpful things ( barewords,
symrefs, etc.. ).
> Returning to use of strict, another guideline is
> this should only be used for large scripts or
> scripts which are very complicated, types of
> scripts where you do need help in analysis of
> whatever problems, assuming command line access
> or special arrangements to read pragma hints.
> Otherwise, strict and other pragma hints are
> useless and often create problems.
Well, I dont use strict for golf... But for everything
else.
> For everyday usage, for average scripts we read
> floating about here within our internet, pragma
> hints are an exercise in futility and an annoying
> exercise in frustration if you are unable to
> read these pragma hints. Additionally, many of
> these 'hints' created are worded in such a way
> as to add more confusion and frustration. In some
> circumstances, pragma hints are simply dead wrong.
> This is yet another classic oxymoron with strict
> and other pragma hints.
Nonsense, either you use strict or you dont.
You have obfuscated your meaning to the point
where no argument I could present would make sense.
I dont understand what is hard to read about:
use strict;
or
Global symbol "@a" requires explicit package name at ./test.pl line 4.
Global symbol "@a" requires explicit package name at ./test.pl line 5.
Execution of ./test.pl aborted due to compilation errors.
And I am certainly not an expert.
> These obvious oxymorons, not having command line
> access and the wording of hints are two fold. Lacking
> command line access is an obvious one. However, this
> other oxymoron is pragma hints are worded in such
> a way, you need to be an expert to make sense of
> what you are reading on your screen. Obviously,
> many times, pragma hints are directed at experts
> rather than those intended to help, beginners.
> Pragma hints are intended to help, but often help
> only those who don't need help; experts in Perl.
> This is a laughable oxymoron.
But above you said that:
> direct experience. Use of strict is very effective
> as a teaching tool until you no longer need it.
This is a laughable oxymoron. :-)
Surely beginners dont start out as experts.
> Pragma hints have a use, a purpose, but should
> be used wisely and with some skepticism. For
> beginners, the moderately skilled in Perl, I would
> say avoid pragma hints like the Black Plague. They
> usually are of no benefit and often create problems.
> This is a matter for personal judgement and choice.
But above you said that they are good for beginners,
you have contradicted yourself once more. The real
oxymoron here is that you are correct in contradicting
yourself, becuase the strict pragma is good for all.
[ snip of more contradiction of self]
[ snip of more great creative writing ]
> Godzilla!
How is Mothra doing? ;^)
Regards,
anm
--
Andrew N. McGuire
andrew.mcguire@walgreens.com
------------------------------
Date: Wed, 26 Apr 2000 13:53:30 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: strict
Message-Id: <MPG.1370f7269447973398a991@nntp.hpl.hp.com>
In article <39074675.59E1BA42@stomp.stomp.tokyo> on Wed, 26 Apr 2000
12:41:41 -0700, Godzilla! <godzilla@stomp.stomp.tokyo> says...
Oh, Lord. I would ignore your subversive blather, could I only assume
that those who read this who are less experienced would know enough to
ignore it also. The potential damage you wreak here is enormous!
> Using strict is liken to using strict rules
> of grammar in language. Works fine for new
> learners, works fine where discipline is a
> must but fails miserably for practical use.
'liken to'? Is there an unknown dialect of English here? Or do strict
rules of grammar in English not apply to you? ('liken' is a verb, but
the sentence requires a predicate of some sort there, specifically an
adjective phrase in this case.)
Let me paraphrase your wisdom:
Using 'strict' is like wearing seatbelts while driving. Works fine for
new learners, works fine to avoid traffic tickets for not wearing them,
but fails miserably for driving on the highway.
How's that for logic?
That's enough. I haven't got the stomach to refute all the rest of your
maunderings. The above should suffice to warn the innocent.
> Godzilla!
Who seems determined to trample over whatever is in sight.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 26 Apr 2000 15:03:52 -0400
From: "David Stiff" <dstiff@delanotech.com>
Subject: system commands failing on Windows NT
Message-Id: <u4HN4.1171$pb6.1241@client>
I have installed Active Perl 516 but "system" commands are failing. Do I
need to install an older build of Perl. (I had this working at a previous
job).
Thanks.
------------------------------
Date: Wed, 26 Apr 2000 12:17:31 -0700
From: Makarand Kulkarni <makarand_kulkarni@My-Deja.com>
Subject: Re: system commands failing on Windows NT
Message-Id: <390740CB.E7F894D@My-Deja.com>
> I have installed Active Perl 516 but "system" commands are failing. Do I
> need to install an older build of Perl. (I had this working at a previous
> job).
System() calls are not available on Activestate's perl for NT.
http://www.activestate.com/ActivePerl/docs/
You have to port your scripts.
See www.activestate.com/ for more info.
---
------------------------------
Date: Wed, 26 Apr 2000 12:19:53 -0700
From: "Lauren Smith" <lauren_smith13@hotmail.com>
Subject: Re: system commands failing on Windows NT
Message-Id: <8e7fhi$ks7$1@brokaw.wa.com>
David Stiff <dstiff@delanotech.com> wrote in message
news:u4HN4.1171$pb6.1241@client...
> I have installed Active Perl 516 but "system" commands are failing. Do I
> need to install an older build of Perl. (I had this working at a previous
> job).
In what way are they 'failing'?
1) Failing to execute?
2) Failing to run correctly?
3) if (system ("something")) ?
Show the code.
Lauren
------------------------------
Date: Wed, 26 Apr 2000 13:19:35 -0700
From: "Charles F. Radley" <cradley@nai.com>
Subject: Re: system commands failing on Windows NT
Message-Id: <8e7i7o$av6$1@zeitung.ngc.com>
Makarand Kulkarni wrote in message <390740CB.E7F894D@My-Deja.com>...
>> I have installed Active Perl 516 but "system" commands are failing. Do I
>> need to install an older build of Perl. (I had this working at a previous
>> job).
>
>System() calls are not available on Activestate's perl for NT.
>http://www.activestate.com/ActivePerl/docs/
>You have to port your scripts.
>See www.activestate.com/ for more info.
>---
>
Excuse me ?
I have been using system calls in Activestate perl for over two years.
------------------------------
Date: Wed, 26 Apr 2000 12:59:00 -0700
From: "Lauren Smith" <lauren_smith13@hotmail.com>
Subject: Re: system commands failing on Windows NT
Message-Id: <8e7hr0$nc6$1@brokaw.wa.com>
Makarand Kulkarni <makarand_kulkarni@My-Deja.com> wrote in message
news:390740CB.E7F894D@My-Deja.com...
> > I have installed Active Perl 516 but "system" commands are failing. Do I
> > need to install an older build of Perl. (I had this working at a
previous
> > job).
>
> System() calls are not available on Activestate's perl for NT.
> http://www.activestate.com/ActivePerl/docs/
> You have to port your scripts.
> See www.activestate.com/ for more info.
Would you care to elaborate more? Are we talking about the same 'system'
command?
Lauren
------------------------------
Date: Wed, 26 Apr 2000 13:06:08 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: system commands failing on Windows NT
Message-Id: <MPG.1370ec097e15032098a98e@nntp.hpl.hp.com>
In article <390740CB.E7F894D@My-Deja.com> on Wed, 26 Apr 2000 12:17:31 -
0700, Makarand Kulkarni <makarand_kulkarni@My-Deja.com> says...
> > I have installed Active Perl 516 but "system" commands are failing. Do I
> > need to install an older build of Perl. (I had this working at a previous
> > job).
>
> System() calls are not available on Activestate's perl for NT.
> http://www.activestate.com/ActivePerl/docs/
Your response is incomprehensible. Of course the system() function is
available on ActivePerl for Windows/DOS. Whatever made you think it
wasn't?
> You have to port your scripts.
> See www.activestate.com/ for more info.
The issue is whether the commands issued and the command-line syntax are
portable. This is easy enough to arrange, by using portable commands
and syntax, and by installing portable commands if needed.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 26 Apr 2000 11:42:23 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: to print a flat data file with a certain lengths ?
Message-Id: <MPG.1370d86fb801180e98a98a@nntp.hpl.hp.com>
In article <8e79hp$gkn$1@nnrp1.deja.com> on Wed, 26 Apr 2000 17:38:03
GMT, r_ramirez@my-deja.com <r_ramirez@my-deja.com> says...
> In article <MPG.136e18748e81da7f98a963@nntp.hpl.hp.com>,
> Larry Rosler <lr@hpl.hp.com> wrote:
> >
> > sprintf "%-60s|%s|%s\n" => $a1, $a2, $a3; # left-adjusted
> >
> > sprintf "%60s|%s|%s\n" => $a1, $a2, $a3; # right-adjusted
>
> Reading the original post, I think he's just trying to
> print the varibles to the filehandle FILE. If that's true,
> then just doing...
>
> printf FILE "%-60s|%s|%s\n", $a1, $a2, $a3; # left-justified
>
> -or-
>
> printf FILE "%60s|%s|%s\n", $a1, $a2, $a3; # right-justified
>
> would also work, correct? Or is there an advantage to
> using sprintf instead.
printf FILEHANDLE FORMAT, LIST
printf FORMAT, LIST
Equivalent to print FILEHANDLE sprintf(FORMAT, LIST), except that $\
(the output record separator) is not appended.
...
Use sprintf to capture the result into a 's'tring. Use printf to print
the result to a filehandle.
My newsreader no longer has the original post, and I don't care to look
it up via Deja.com.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 26 Apr 2000 18:36:21 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: trying to access elements of a scalar variable
Message-Id: <sgedp5f1qtj77@corp.supernews.com>
Larry Rosler (lr@hpl.hp.com) wrote:
: But he could also do 'chop reverse $scalar', as he doesn't seem to mind
: using 'chop several times'. One chop will do it. :-)
Or, for those in favor of chopping several times, absurdity, and senseless
destruction of data (and assuming the scalar is in $_):
$first_char = chop while length;
I find that satisfying, somehow. :)
--
| Craig Berry - cberry@cinenet.net
--*-- http://www.cinenet.net/users/cberry/home.html
| "The road of Excess leads to the Palace
of Wisdom" - William Blake
------------------------------
Date: Wed, 26 Apr 2000 18:41:04 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: trying to access elements of a scalar variable
Message-Id: <sgee20r7qtj140@corp.supernews.com>
Godzilla! (godzilla@stomp.stomp.tokyo) wrote:
: Reverse your string and chop. You will find
: this to be quite efficient. Protect your original
: string by creating a new variable, if needed.
:
: $my_new_string = $my_old_string;
: $my_new_string = reverse ($my_new_string);
: $my_new_string = chop ($my_new_string);
Probably a lot easier to do
$first_char = chop($_ = reverse $my_old_string);
--
| Craig Berry - cberry@cinenet.net
--*-- http://www.cinenet.net/users/cberry/home.html
| "The road of Excess leads to the Palace
of Wisdom" - William Blake
------------------------------
Date: Wed, 26 Apr 2000 15:07:40 -0400
From: "Martin Trautmann" <matst90@katz.pitt.edu>
Subject: Re: trying to access elements of a scalar variable
Message-Id: <8e7epe$sug$1@usenet01.srv.cis.pitt.edu>
how do you know in which documentation to look, there are so many
and the names are not always really helpful...
is there something like an index where you can lookup a specific
command that references to the doc ?!?
mt
Tony Curtis <tony_curtis32@yahoo.com> wrote in message
news:87itx4kf43.fsf@shleppie.uh.edu...
> >> On Wed, 26 Apr 2000 12:17:53 -0400,
> >> "Martin Trautmann" <matst90@katz.pitt.edu> said:
>
> > hi, i'm trying to access a specific character (the first
> > one) of a scalar variable. i don't really want to use
> > chop several times till i have it...
>
> perldoc -f substr
> perldoc perlre
>
> (perldoc is your friend)
>
> hth
> t
------------------------------
Date: Wed, 26 Apr 2000 12:14:12 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: trying to access elements of a scalar variable
Message-Id: <Pine.GSO.4.10.10004261213320.25963-100000@user2.teleport.com>
On Wed, 26 Apr 2000, Martin Trautmann wrote:
> > (perldoc is your friend)
> how do you know in which documentation to look, there are so many
> and the names are not always really helpful...
> is there something like an index where you can lookup a specific
> command that references to the doc ?!?
perltoc is your friend. :-)
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 26 Apr 2000 12:26:38 -0700
From: "Lauren Smith" <lauren_smith13@hotmail.com>
Subject: Re: trying to access elements of a scalar variable
Message-Id: <8e7fu6$lva$1@brokaw.wa.com>
Martin Trautmann <matst90@katz.pitt.edu> wrote in message
news:8e7epe$sug$1@usenet01.srv.cis.pitt.edu...
> how do you know in which documentation to look, there are so many
> and the names are not always really helpful...
> is there something like an index where you can lookup a specific
> command that references to the doc ?!?
Excellent question!
At your command prompt, type in 'perldoc perldoc'. This is the online
reference grepper. The previous command will give you a list of flags that
can be passed to perldoc.
Try these too:
perldoc perl
perldoc perlfunc
perldoc perlfaq
There's a lot of information already on your harddrive, and it can all be
accessed by perldoc.
Lauren
------------------------------
Date: Wed, 26 Apr 2000 14:50:26 -0500
From: Tom Briles <sariq@texas.net>
Subject: Re: trying to access elements of a scalar variable
Message-Id: <39074882.C38764C2@texas.net>
Lauren Smith wrote:
>
> Martin Trautmann <matst90@katz.pitt.edu> wrote in message
> news:8e7epe$sug$1@usenet01.srv.cis.pitt.edu...
> > how do you know in which documentation to look, there are so many
> > and the names are not always really helpful...
> > is there something like an index where you can lookup a specific
> > command that references to the doc ?!?
>
> Excellent question!
>
> At your command prompt, type in 'perldoc perldoc'. This is the online
> reference grepper. The previous command will give you a list of flags that
> can be passed to perldoc.
>
> Try these too:
>
> perldoc perl
> perldoc perlfunc
> perldoc perlfaq
All good advice, but you've left out the page most relevant to the
poster's question:
perldoc perltoc
- Tom
------------------------------
Date: Wed, 26 Apr 2000 13:19:08 -0700
From: "Lauren Smith" <lauren_smith13@hotmail.com>
Subject: Re: trying to access elements of a scalar variable
Message-Id: <8e7j0l$kj4$1@brokaw.wa.com>
Tom Briles <sariq@texas.net> wrote in message
news:39074882.C38764C2@texas.net...
>
> All good advice, but you've left out the page most relevant to the
> poster's question:
>
> perldoc perltoc
'perldoc perl' gives a brief description of each document (core modules
notwithstanding). The toc is too long, in my opinion, to easily use as a
toc. Of course, I really shouldn't complain, as I'm not forthcoming with a
patch. :-)
Lauren
------------------------------
Date: Wed, 26 Apr 2000 16:13:40 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: trying to access elements of a scalar variable
Message-Id: <slrn8gejfk.8k1.tadmc@magna.metronet.com>
On Wed, 26 Apr 2000 14:50:26 -0500, Tom Briles <sariq@texas.net> wrote:
>Lauren Smith wrote:
>>
>> Martin Trautmann <matst90@katz.pitt.edu> wrote in message
>> news:8e7epe$sug$1@usenet01.srv.cis.pitt.edu...
>> > how do you know in which documentation to look, there are so many
>> > and the names are not always really helpful...
>> > is there something like an index where you can lookup a specific
^^^^^^^^
^^^^^^^^
>> > command that references to the doc ?!?
^^^^^^^
^^^^^^^
>> At your command prompt, type in 'perldoc perldoc'. This is the online
>> reference grepper. The previous command will give you a list of flags that
>> can be passed to perldoc.
>>
>> Try these too:
>>
>> perldoc perl
>> perldoc perlfunc
>> perldoc perlfaq
>
>All good advice, but you've left out the page most relevant to the
>poster's question:
>
>perldoc perltoc
I think the most relevant advice would have been:
perldoc -f commandnamehere
:-)
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Wed, 26 Apr 2000 14:49:15 -0400
From: "Edward Waldspurger" <ewald@electronicfrontiers.com>
Subject: Which modules are loaded on my server?
Message-Id: <39073a39_1@news.siscom.net>
How can I tell if a particular Perl module is loaded on my server? Are all
.pm files in the @INC directories available to use as modules, or is there
more too it than that?
--
Edward Waldspurger
Electronic Frontiers Consulting
------------------------------
Date: Wed, 26 Apr 2000 12:03:49 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Which modules are loaded on my server?
Message-Id: <Pine.GSO.4.10.10004261157510.25963-100000@user2.teleport.com>
On Wed, 26 Apr 2000, Edward Waldspurger wrote:
> How can I tell if a particular Perl module is loaded on my server?
You're talking about a webserver, right?
If you try using it but get a "Can't locate ____ in @INC" error, that's a
bad sign. :-)
> Are all .pm files in the @INC directories available to use as modules,
> or is there more too it than that?
A little more. If you're running with taint checks on, you won't have '.'
in the @INC list. If you use 'use lib', you may add to the list in @INC at
compile time, before a module is loaded. A module may have more parts to
it than just the .pm file; if it's missing something (usually due to
improper installation) it can't work right.
Of course, there's no guarantee that the perl you're using from the shell
is the same as the one on the webserver; check with your local expert for
more information.
If you're having trouble loading any modules at all, here's something
which may help. There are other ways to do this, but for debugging, I
sometimes put something like this near the top of a script.
# Remove this block when done debugging!
BEGIN {
local($|) = 1; # Temporarily turn off buffering
print "Content-type: text/plain\n\n";
my $date = localtime;
print "Script $0\nrunning on $date (Perl version $])\n\n";
unless (open STDERR, ">&STDOUT") {
print "Can't redirect STDERR: $!";
exit;
}
print "\n";
print "\@INC seems to be:\n", map "\t$_\n", @INC;
print "\n";
}
Now you should be able to see any error messages (and everything else)
produced by your script, right on your browser. Good luck with it!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 26 Apr 2000 13:21:46 -0700
From: Jon Ericson <Jonathan.L.Ericson@jpl.nasa.gov>
Subject: Re: Win98 Pipe problem
Message-Id: <39074FDA.C950B950@jpl.nasa.gov>
bennyboy00@my-deja.com wrote:
> Ok, so I ran the following 2 programs on win98.
>
> #!/usr/local/bin/perl -w
> use strict;
> open(Reader, 'dir|') or die "Cannot open pipe";
> while(<Reader>) {
> print $_;
> }
>
> This programs hangs forever on win98 when it gets to the $_.
Very odd. As you have noted, this works perfectly on NT. I don't have
access to Win 98 at the moment, so I can't verify your results. Have
you tried other commands to read from such as 'echo hi|' or the
incestuous 'perl -e "print qq(hi\n)"|'? This way you can control your
input. (The $_ is superfluous here since print uses $_ if it is not
passed a list. Also including $! somewhere in the die message while
give you more information on the cause of any open failures.)
> #!/usr/local/bin/perl -w
> use strict;
> open(Reader, 'dir|') or die "Cannot open pipe";
> while(<Reader>) {
> print <Reader>;
> }
Err... I think you misunderstood me (or I wasn't clear enough). I meant
for 'print <Reader>;' to replace the entire while loop.
Jon
--
Knowledge is that which remains when what is
learned is forgotten. - Mr. King
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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.
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 V9 Issue 2873
**************************************