[12998] in Perl-Users-Digest
Perl-Users Digest, Issue: 408 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Aug 6 18:07:22 1999
Date: Fri, 6 Aug 1999 15:05:10 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Fri, 6 Aug 1999 Volume: 9 Number: 408
Today's topics:
Re: $ARGV HELP... <ehpoole@ingress.com>
CRAP-7 ATTN: Article 002 - HTTP Cookie Library <jeffp@crusoe.net>
embedded perl and malloc. abhidon@hotmail.com
exists problem <gene@tekdata.com>
Re: exists problem <rootbeer@redcat.com>
Functions in <<HERE documents <dwatanab@uci.edu>
Re: Functions in <<HERE documents <tchrist@mox.perl.com>
having trouble with ping command.... <seongbae@students.uiuc.edu>
Re: just days away f7.8ez5.88ox <mconnell@lineone.net>
Re: Nastiness contrary to the spirit of perl? (Bart Lateur)
Re: Nastiness contrary to the spirit of perl? (I R A Darth Aggie)
Newbie Question Ragrding DBD::XBase On Remote Server (Mr. Baseball)
Re: NT Apache Perl (Bill Moseley)
Re: NTLM Authorization (Mark Leighton Fisher)
Re: perl script running as a different uid cannot load <paul.glidden@unisys.com>
Re: perl script running as a different uid cannot load <rootbeer@redcat.com>
Re: Problems Quoting # in qw,... <All@n.due.net>
Re: Quick Question :) (Bart Lateur)
reverse of localtime? <kin@symmetrycomm.com>
Re: Sorting in a hash of hashs over two keys <tchrist@mox.perl.com>
Re: Weird perl behavior under inetd <tchrist@mox.perl.com>
What's the scope of $_ ? <kj0@mailcity.com>
Re: What's the scope of $_ ? <tchrist@mox.perl.com>
Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 06 Aug 1999 17:56:23 -0400
From: "Ethan H. Poole" <ehpoole@ingress.com>
Subject: Re: $ARGV HELP...
Message-Id: <37AB5A07.496E2699@ingress.com>
[posted and emailed]
Dave Shaffer wrote:
>
> I have a PERL script that does different actions based on the argument
> it was called with. For example, the following hyperlink calls the
> script with "Edit" as an argument. The script works on a test box but
> the $ARGV variables are not getting set on the productin box.
>
> <A HREF="notices.pl?Edit">Edit Notices</A>
>
> In notices.pl the following code looks for the argument passed and
> performs the appropriate action.
<snip...>
> The $ARGV variable does not seem to getting set.
>
> Any ideas???
Yes, learn the CGI specs and you'll learn you should *not* be using
$ARV[x]. Just because you can get away with it occassionally does not make
it proper.
Try taking a look at $ENV{QUERY_STRING} instead and you might find
something rather amazing.
--
Ethan H. Poole **** BUSINESS ****
ehpoole@ingress.com ==Interact2Day, Inc.==
(personal) http://www.interact2day.com/
------------------------------
Date: Fri, 6 Aug 1999 17:57:31 -0400
From: Jeff Pinyan <jeffp@crusoe.net>
Subject: CRAP-7 ATTN: Article 002 - HTTP Cookie Library
Message-Id: <Pine.GSO.4.10.9908061756160.5255-100000@crusoe.crusoe.net>
BEGIN { $CRAP = "http://www.pobox.com/~japhy/perl/crap" }
I finished it about two minutes ago, and I'd like some reviews and/or
critiques. It can be accessed at the CRAP web site:
$CRAP/002-cookielib/article.pod
$CRAP/utils/podviewer.cgi
(see above for expansion of $CRAP)
We should have two or three more articles coming in soon!
--
jeff pinyan japhy@pobox.com
japhy's little hole in the (fire) wall: http://www.pobox.com/~japhy
perl stuff japhy+perl@pobox.com
japhy's perl supposit^Wrepository: http://www.pobox.com/~japhy/perl
CPAN ID: PINYAN http://www.perl.com/CPAN/authors/id/P/PI/PINYAN
------------------------------
Date: Fri, 06 Aug 1999 21:03:53 GMT
From: abhidon@hotmail.com
Subject: embedded perl and malloc.
Message-Id: <7ofijg$qcl$1@nnrp1.deja.com>
Hi,
We have perl embedded in our application. It is for Solaris 2.x and
HP UX 10.20. While building perl and perl libraries, we configure the
build, NOT to use perl's malloc(). This means, perl should use the
system malloc(). This is the library, our application is linked against.
We put in some trace statements in perl's malloc (pp_sys.c), and
they showed up. This indicates, that perl IS using it's own malloc,
inspite the fact, we configured it not to!
Another strange behavior we are seeing is that, perl exits in malloc
(). I mean, the behavior is valid, 'coz the requested memory is more
than a gigabyte! All the debugging we have done so far indicates, that,
the problem lies within the embedded code. Something gets corrupted
when perl's malloc() is called.
Could somebody tell us, how to debug embedded perl? We would like
to know, who is calling malloc, with such a big request. Some kind of
functionality, which let us have the stack trace, of malloc().
We also see a lot of "Bad free" calls. Again, we want to know, who
is calling free and why perl thinks, they are "bad".
The application is multi-threaded, and the stack trace in the does
not neccessarily give us the exact stack we want. The problem occurs
inconsistently and we do not have access to the debugger, when it
actually happens.
Thanx in advance,
:-)abhi
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Fri, 06 Aug 1999 16:10:53 -0500
From: root <gene@tekdata.com>
Subject: exists problem
Message-Id: <37AB4F5D.BB5FE140@tekdata.com>
I have the following statement in a script
if ( exists $in { 'Econf'} ) {
print $HANDLE 'Econf $in{'Econf'}\r';
&wait'ok }
$in contains a list of arguments from a web server. This works on my
test system. But on some field system it halts the script. The system
it fails on is running perl 5.002
I want to execute the print statement iff the Econf variable existed
on the page coming back from a web server. I was under the
impression that the exists statement will search the $in array and
return false if the Econf member wasn't there.
Thanks in advance
Gene
------------------------------
Date: Fri, 6 Aug 1999 14:48:42 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: exists problem
Message-Id: <Pine.GSO.4.10.9908061440300.9452-100000@user2.teleport.com>
On Fri, 6 Aug 1999, root wrote:
> if ( exists $in { 'Econf'} ) {
> print $HANDLE 'Econf $in{'Econf'}\r';
Don't put single quotes in a single-quoted string, and don't use
single-quoted strings when you want interpolation. And do you want HANDLE
or $HANDLE? Did you really mean "\r"? Maybe you want this?
print HANDLE "Econf $in{Econf}\n";
> &wait'ok }
This looks like it was borrowed from some _old_ code. Maybe you want
&wait::ok.
> $in contains a list of arguments from a web server.
Do you mean %in?
> The system it fails on is running perl 5.002
Since that's a version of Perl that's older than the Spice Girls, you
should see about upgrading.
> I want to execute the print statement iff the Econf variable existed
> on the page coming back from a web server.
See the docs for the CGI module, or a similar module.
> I was under the impression that the exists statement will search the
> $in array and return false if the Econf member wasn't there.
If you replace '$in array' with '%in hash', you'll be well on your way
towards enlightenment. Have fun with Perl!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Fri, 06 Aug 1999 10:10:07 -0700
From: =?iso-8859-1?Q?d=E1na?= watanabe <dwatanab@uci.edu>
Subject: Functions in <<HERE documents
Message-Id: <37AB16ED.2414F79B@uci.edu>
is there more documentation on what can be done with <<HERE stuff
than
http://www.perl.com/cgi-bin/pace/pub/doc/manual/html/pod/perlfaq4.html#Why_don_t_my_HERE_documents_wo
and man perldata ?
specifically, i'd like to know if there is any other way to have a
functions output be integrated without using printf
e.g.
print "<form>\n<select name=month>\n".print_opts(12)."</select>\n<select name=day>\n".print_opts(31)."</select>\n";
can work as:
printf "%s%s%s%s%s",<<EOF,print_opts(12),<<EOF,print_opts(31),<<EOF;
<form>
<select name=month>
EOF
</select>
<select name=day>
EOF
</select>
EOF
is there any other way to do this?
(well, aside from asigning the print_opts returns to variables and just
including those)
thanks
------------------------------
Date: 6 Aug 1999 15:52:29 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Functions in <<HERE documents
Message-Id: <37ab591d@cs.colorado.edu>
[courtesy cc of this posting mailed to cited author]
In comp.lang.perl.misc,
dwatanab@uci.edu writes:
:printf "%s%s%s%s%s",<<EOF,print_opts(12),<<EOF,print_opts(31),<<EOF;
What's wrong with:
print <<EOF,print_opts(12),<<EOF,print_opts(31),<<EOF;
And read the FAQ about expanding function calls in strings.
--tom
--
You know, by the time you get some with all this, the "Swiss Army
Chainsaw" is going to be more like a Swiss Army Tactical Nuke.... :-)
--Brandon Allbery on perl in <1991Feb21.002412.20045@NCoast.ORG>
------------------------------
Date: Fri, 6 Aug 1999 16:43:31 -0500
From: seong joon bae <seongbae@students.uiuc.edu>
Subject: having trouble with ping command....
Message-Id: <Pine.GSO.4.10.9908061639240.18807-100000@ux12.cso.uiuc.edu>
Hello,
Can anyone tell me why the below script only works with local machines?
#!/usr/local/bin/perl
use Net::Ping;
$p = Net::Ping->new();
printf "$host is alive\n" if $p->ping($host1);
$p->close();
when i put some local machine into $host, it works.
but if i put some other machine, say like...www.be.com, it doesn't work.
Can anyone tell me why?
Thank you.
------------------------------
Date: Fri, 6 Aug 1999 22:47:45 +0100
From: "Michael Connell" <mconnell@lineone.net>
Subject: Re: just days away f7.8ez5.88ox
Message-Id: <5IIq3.4770$dE1.6107@newreader.ukcore.bt.net>
> This is no mere coincidence my friends. The Lord is Present.
While he's here can he please tell us whether a ticket from London to
Carlisle route Direct is or isn't valid via the Settle & Carlisle?
------------------------------
Date: Fri, 06 Aug 1999 21:19:10 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Nastiness contrary to the spirit of perl?
Message-Id: <37ad5023.6653889@news.skynet.be>
Darrell Stec wrote:
>Yes, there is a tremendous amount of free documentation written. But shear
>volume does not make it good, nor easy to navigate. The documentation is as
>easy to find something in as finding a particular sentence in a novel with
>titles such as chapter one, chapter two, chapter three, etc., {perlfaq1,
>perfaq2, perfaq3 or the equally descriptive perlapio, perldsc}.
The Unix people would say: use "grep" (a command line search utility) to
search through the files. Windoze people can even try the "Find File"
system tool ("files that contain...").
But actually, I think it wouldn't be a to bad idea, if perldoc were
extended so it allows word or grep searches too. TomC might jump on me
for this... but perldoc needn't be the monolith it is now. It could
easily be modified into just a shell to several subtools, which can then
be just different modules, such as pod2*.
Bart.
------------------------------
Date: 6 Aug 1999 21:25:07 GMT
From: fl_aggie@thepentagon.com (I R A Darth Aggie)
Subject: Re: Nastiness contrary to the spirit of perl?
Message-Id: <slrn7qmkpn.9pa.fl_aggie@thepentagon.com>
On 06 Aug 1999 18:18:58 GMT, Darrell Stec <darstec@aol.com>, in
<19990806141858.22915.00003391@ngol05.aol.com> wrote:
+ I don't think there were ever "real" standards on the Internet.
Oh, yes there are. Speaking of which, as a matter of nettiquette,
could you trim your line folding to about 72 or so characters? thanks.
+ The Internet is the story of those who had one thing in mind when
+ they started it, tried to maintain that view, and watched it change by
+ the participants who wanted to use it for their own purposes. Email
+ was an example of that. Beyond the designer's imagination, the users
+ started to send personal messages as well as the intended research
+ information.
Ummm...as far as I know, there was never an RFC concerning personal
email communication...
+ Yes, there is a tremendous amount of free documentation written. But shear
+ volume does not make it good,
You're right. What makes it good is the relative completeness, and the
fact that it is shipped with *every*decent*perl*distribution*!!!
+ nor easy to navigate.
There are tools for that...
+ The documentation is as
+ easy to find something in as finding a particular sentence in a novel with
+ titles such as chapter one, chapter two, chapter three, etc., {perlfaq1,
+ perfaq2, perfaq3 or the equally descriptive perlapio, perldsc}.
Please. Why don't you go and install perlindex:
NAME
perlindex - index and query perl manual pages
SYNOPSIS
perlindex -index
perlindex tell me where the flowers are
DESCRIPTION
"perlindex -index" generates an AnyDBM_File index which
can be searched with free text queries "perlindex a
verbose query".
Each word of the query is searched in the index and a
score is generated for each document containing it. Scores
for all words are added and the documents with the highest
score are printed. All words are stemed with Porters
algorithm (see the Text::English manpage) before indexing
and searching happens.
+ Then perhaps these "very same people" who give the RTFM give this response
+ because they WTFM and just like to see their name in print.
Ocham's razor suggests otherwise...
+ I agree with you there. It would be exasperating for the authors to
+ answer the same questions that are in their books, over and over
+ again. After all those that wrote the books, did so for the money,
Why those greedy bastards! I'm surprised they're not charging license
fees on the software they give away! That's no way to run a railroad!
They'll go broke, and without corporate sponsorship, perl will go the
way of the dodo bird within a year...
Sheesh, many of them go so far as to put the code examples on-line,
instead of making you buy the book and typing them in...
+ not because they love teaching which involves explaining the answer
+ over and over again in many parallel ways until the student
+ understands it.
Have you ever taught before?
+ Then don't steer them to the documentation. If they have it and still
+ need to ask a question, then obviously that documentation is too
+ cumbersome, or doesn't explain the answer in a way the questioner
+ understands.
Or perhaps they don't know how to post? I don't think I've seen anyone
post like this and get flamed for it:
I read the documentation, but I just don't get it.
This type of person makes a good-faith effort to Get It. This is like
the student who comes in and says "I was in your lecture, but I don't
understand." Ignorance can be cured.
+ How do you know that they are ignoring the documentation instead of
+ just not understanding it.
Because they may make a reference to reading the docs and not understanding
them...
[examples of products]
+ The first thing the owners of these products do, before they read the
+ manual is to call the manufacturerer's toll free number, or the store
+ where they purchased it from. You should try dealing with people that
+ buy cash registers, if you think this newsgroup is bad.
The difference between here and there is?
HINT: They gave you money for a product and the promise of
support. Compare and contrast what you gave to get perl.
+ Perl like the C language...IMO they are two of the more inane because
+ of their cryptic, terse style.
Only if you're an undisciplined programmer. A good, disciplined
programmer writes good, almost self-documenting code in any language.
+ Some else will answer those questions in your stead.
Which is worse: RTFM and come back if you don't understand, or an
answer that is incorrect? in the CGI newsgroup (comp.infosystems.www.cgi,
I think) today someone posted date code they said was Y2K safe, along
the lines of
(...$year...)=gmtime(time-$offset);
if ($year==99) {
$year="1999";
}else{
$year="20$year";
}
It is to say the least a most unique Y2K bug they've introduced. It is
left to the reader to discover *why* that code is WRONG WRONG WRONG.
James
------------------------------
Date: Fri, 06 Aug 1999 21:15:52 GMT
From: mrbaseball2@rocketmail.com (Mr. Baseball)
Subject: Newbie Question Ragrding DBD::XBase On Remote Server
Message-Id: <37ab4fd3.13261774@news>
Good Afternoon,
I am just getting into the wide world of DBI and DBD in Perl. I have
been reading the FAQs and surfing the Net and still come up short
regarding one question: What is necessary to access a remote database
using the DBI and DBD modules on a WinNT server? All the code examles
I have seen only poll a local database with their queries.
Any help on this issue is greatly appreciated.
Sincerely,
Brad Bradley
------------------------------
Date: Fri, 6 Aug 1999 14:14:40 -0700
From: moseley@best.com (Bill Moseley)
Subject: Re: NT Apache Perl
Message-Id: <MPG.1214f020a1b8ccc698968b@nntp1.ba.best.com>
UUCP (UUCP@p1.f3.n500.z2.hccfido.hcc.nl) seems to say...
> But Apache does. Even in win32, you have to have the proper path to
> the Perl executable on the shebang line, or Apache will hate you for it.
I haven't tired it yet, but I think Apache 1.3.6 now can use the registry
to find the application to run.
http://www.apache.org/dist/CHANGES_1.3
*) Win32: Add new config directive, ScriptInterpreterSource, to enable
searching the Win32 registry for script interpreters.
[Bill Stoddard]
--
Bill Moseley mailto:moseley@best.com
pls note the one line sig, not counting this one.
------------------------------
Date: Fri, 6 Aug 1999 16:09:14 -0500
From: fisherm@tce.com (Mark Leighton Fisher)
Subject: Re: NTLM Authorization
Message-Id: <MPG.1215190314848ff9896c0@news-indy.indy.tce.com>
In article <7md9t4$phi$1@nnrp1.deja.com>, dafah@wmdata.com says...
> Are there any documentation about how the NT Challenge Response / NTLM
> Authorization headers interact? It seemes as Microsoft does not publish
> this information. But would need this to build a proxy server.
Samba (www.samba.org) has been doing this for years. You need to look in
CPAN for code dealing with SMB, the Server Message Block protocol. Most
of what you want is already written.
==========================================================
Mark Leighton Fisher Thomson Consumer Electronics
fisherm@.tce.com Indianapolis, IN
"Browser Torture Specialist, First Class"
------------------------------
Date: Fri, 6 Aug 1999 16:12:11 -0500
From: "Paul Glidden" <paul.glidden@unisys.com>
Subject: Re: perl script running as a different uid cannot load package
Message-Id: <7ofj2u$ch2$1@eanews1.unisys.com>
<message cc to writer as courtesy>
Thanks for the explanation Tom.
Alright, I understand the @INC problem now, and have fixed that issue.
But another issue has come up. My goal is to connect to an Oracle database
as user oracle. So I changed the ownership to oracle and turned on the suid
bit.
When I run the script as another user, only the euid is changed to oracle,
not the uid. Unfortunately Oracle will not recognize the euid as being the
user oracle, and is not letting me connect to the database as oracle.
I have written a shell script that can be run as root that allows me to su
to oracle then run the perl script, but this defeats the purpose I was
looking to accomplish here.
Why is perl only setting the euid and not the uid? Does anyone know of a
workaround to this?
thanks again,
Tom Phoenix wrote in message ...
>Replace "altering" with "distrusting". When running suid, Perl knows to
>have no faith in the integrity of the environment, so it won't open a
>security hole by automatically including the current directory in @INC.
>See the perlsec manpage for more information. Cheers!
------------------------------
Date: Fri, 6 Aug 1999 14:58:32 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: perl script running as a different uid cannot load package
Message-Id: <Pine.GSO.4.10.9908061451580.9452-100000@user2.teleport.com>
On Fri, 6 Aug 1999, Paul Glidden wrote:
> When I run the script as another user, only the euid is changed to
> oracle, not the uid.
That's what suid does; to change the uid, you need the kernel's
permission.
> Unfortunately Oracle will not recognize the euid as being the
> user oracle, and is not letting me connect to the database as oracle.
Complain to Oracle! :-)
> I have written a shell script that can be run as root that allows me
> to su to oracle then run the perl script, but this defeats the purpose
> I was looking to accomplish here.
Well, if your Perl program is running as root, you should be able to set
the uid to whatever you want. See perlvar and perlsec.
> Why is perl only setting the euid and not the uid?
I'm pretty sure your system, not perl, is setting the euid. Again, that's
what suid is all about.
Have fun with it!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Fri, 06 Aug 1999 21:58:29 GMT
From: "Allan M. Due" <All@n.due.net>
Subject: Re: Problems Quoting # in qw,...
Message-Id: <9UIq3.30446$um6.366962@news2.rdc1.on.home.com>
Xeno Campanoli <xeno@bigger.aa.net> wrote in message
news:933969880.522219@cacheraq001...
: This was previously, mistakenly, posted under something like
: "Need SSH2 Help".
: I'm trying to put a list of words in an array as elegantly as possible.
: One of the words, however, is the sharp or pound sign character (#). I
: lastly posted the following:
: Tom Briles <sariq@texas.net> wrote:
: >: Xeno Campanoli wrote:
: >:>
: >:> How do I do:
: >:>
: >:> @x = qw( C D . _ # M X N M V ALL )
: >:>
: >: qq
: >: - Tom
: >Nope. That doesn't work. I want an answer that lets the following loop
: >for $x (@x)
:
: >print "x: $x\n";
: >}
: >to print:
: >x: C
: >x: D
: >x: .
: >x: _
: >x: #
: >x: M
: >x: X
: >x: M
: >x: V
: >x: ALL
: >
I must be missing something. For me:
#! perl -w
use strict;
my @x = qw( C D . _ # M X N M V ALL );
for my $x (@x) {
print "x: $x\n";
}
print `perl -v`;
__END__
Gives:
Possible attempt to put comments in qw() list at C:\EDIT1.PL line 4.
x: C
x: D
x: .
x: _
x: #
x: M
x: X
x: N
x: M
x: V
x: ALL
This is perl, version 5.005_02 built for MSWin32-x86-object
-----
So I get the warning but everything else seems to work fine.
HTH
AmD
--
$email{'Allan M. Due'} = ' All@n.Due.net ';
--Random Quote--
A computer lets you make more mistakes faster than any invention in human
history - with the possible exceptions of handguns and tequila.
Mitch Ratliffe
------------------------------
Date: Fri, 06 Aug 1999 21:26:16 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Quick Question :)
Message-Id: <37ae526e.7240927@news.skynet.be>
Ivan Berg wrote:
>Anybody know how to add two binary number together.
>When adding using th '+' operator I get a scientific notation number.
>
>For instance, how would one add '011' and 100' and get '111'??
Convert the numbers to decimal, add, and then convert to binary again.
Unfortunaltely for you, Perl doesn't really support binary, as it does
hexadecimal and octal. You'll have to build a kludge using pack/unpack
with "B" template. Which is beyond my taste for adventure, for the
moment... ;-)
Bart.
------------------------------
Date: 6 Aug 1999 21:16:26 -0000
From: Kin Cho <kin@symmetrycomm.com>
Subject: reverse of localtime?
Message-Id: <19990806211626.17158.qmail@nym.alias.net>
Hi,
I'm seeking a function when given the output string of localtime
(in scalar context), returns the output of time() (number of seconds
since 1970...).
TIA,
-kin
------------------------------
Date: 6 Aug 1999 15:54:46 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Sorting in a hash of hashs over two keys
Message-Id: <37ab59a6@cs.colorado.edu>
[courtesy cc of this posting mailed to cited author]
In comp.lang.perl.misc,
ricardo_mireles@my-deja.com writes:
:In article <slrn7qcgtu.9a5.sholden@pgrad.cs.usyd.edu.au>,^M
:sholden@cs.usyd.edu.au wrote:^M> On Tue, 03 Aug 1999 01:00:13 GMT,
:macarthy@my-deja.com wrote:^M> >I'm trying to sort an array of hashes such as:
:...^M> ^M> You read the documentation that comes with perl.^M...^M> Sam^M^MI read
:"perldsc". Can you please hint where I can find more about creating a list of
:records sorted across two "fields" in a Hash of Hashes.^M^MEx: sort by lastname
:then by firstname in :^M^M %HoH = (^M 10 => { lastname => "flintstone",
:firstname => "fred", },^M 1 => { lastname => "flintstone", firstname =>
:"wilma", },^M 27 => { lastname => "flintstone", firstname => "bambam",
:},^M 90 => { lastname => "jetsons", firstname =>"george", },^M 31 => {
:lastname => "jetsons", firstname => "jane", },^M 62 => { lastname =>
:"jetsons", firstname => "elroy", },^M 40 => { lastname => "simpsons",
:firstname => "homer", },^M 13 => { lastname => "simpsons", firstname =>
:"marge", },^M 42 => { lastname => "simpsons", firstname => "bart", },^M);
:^Mresulting in:^M@sortedlist = (27, 10, 1, 62, 90, 31, 42, 40, 13) ;^M^Mricardo
You honestly expect anyone to read that?
--tom
--
Churchill's Commentary on Man: Man will occasionally stumble over the
truth, but most of the time he will pick himself up and continue on.
------------------------------
Date: 6 Aug 1999 15:56:16 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Weird perl behavior under inetd
Message-Id: <37ab5a00@cs.colorado.edu>
[courtesy cc of this posting mailed to cited author]
In comp.lang.perl.misc,
Laird Nelson <ljnelson@unix.amherst.edu> writes:
:I used an M$ newsreader to post this question earlier, and I think it
:may have eaten it or decided that it was smarter than I was and deemed
:my question too idiotic to trouble this newsgroup with.
Or maybe it was cleverly killfiled. :-)
:The problem is that printing the variable that was read in via <STDIN>
:does NOT work when there's a newline after it (as in the for loop
:above) and when the program is running under inetd control. This
:program works fine when run at the command line.
:
:Any idea what's going on?
My best guess is something related to buffering. Try a ++$|
at the top.
--tom
--
The IQ of the group is the lowest IQ of a member of the group divided
by the number of people in the group.
------------------------------
Date: 6 Aug 1999 21:24:23 GMT
From: kj0 <kj0@mailcity.com>
Subject: What's the scope of $_ ?
Message-Id: <7ofjq7$mtu$1@news.panix.com>
What's the scope of $_ ? (The index of the Camel book is no help
here.)
Thanks,
KJ
------------------------------
Date: 6 Aug 1999 16:02:54 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: What's the scope of $_ ?
Message-Id: <37ab5b8e@cs.colorado.edu>
[courtesy cc of this posting mailed to cited author]
In comp.lang.perl.misc,
kj0 <kj0@mailcity.com> writes:
:What's the scope of $_ ? (The index of the Camel book is no help
:here.)
Chapter Two:
Global Special Variables
There are quite a few variables that are global in the fullest
sense--they mean the same thing in every package. If you want a
private copy of one of these, you must localize it in the current
block.
$_
$ARG
The default input and pattern-searching space. ....
The only implicit local()ization occurs at a map{}, a grep{},
or a foreach() that has no explicit index variable. It doesn't
happen at a subroutine call, and it doesn't happen with a while
loop. You can of cource local() it yourself. Note very very
carefully that something you local() is *STILL GLOBAL*.
--tom
--
"Behavior is a mirror in which everyone displays his image."
- Johann Wolfgang von Goethe
------------------------------
Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 1 Jul 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.
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 V9 Issue 408
*************************************