[13980] in Perl-Users-Digest
Perl-Users Digest, Issue: 1390 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Nov 15 21:16:34 1999
Date: Mon, 15 Nov 1999 18:15:25 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <942718524-v9-i1390@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Mon, 15 Nov 1999 Volume: 9 Number: 1390
Today's topics:
Re: system() fails to return error code <rootbeer@redcat.com>
Re: Trying to use a variable as an operator (Alan Curry)
Re: Trying to use a variable as an operator (Craig Berry)
Re: Trying to use a variable as an operator <uri@sysarch.com>
Re: Trying to use a variable as an operator <slanning@bu.edu>
Re: Unexpected error in array <cassell@mail.cor.epa.gov>
Re: Unload/reload modules? <rootbeer@redcat.com>
Re: unwanted refresh with Apache server <reembar@netvision.net.il>
Re: unwanted refresh with Apache server (Martien Verbruggen)
Re: unwanted refresh with Apache server <cassell@mail.cor.epa.gov>
Where can i find more information on Schwartzian transf <Benjamin_Gu@email.mot.com>
Re: Where can i find more information on Schwartzian tr <uri@sysarch.com>
Re: Why perl won't print to STDOUT? <jkline@one.net>
Re: Why perl won't print to STDOUT? <cassell@mail.cor.epa.gov>
Re: Win32 module questions <cassell@mail.cor.epa.gov>
Re: Win32 module questions <mruedy@alidian.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 15 Nov 1999 16:49:55 -0800
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: system() fails to return error code
Message-Id: <Pine.GSO.4.10.9911151647190.15797-100000@user2.teleport.com>
On Wed, 10 Nov 1999, Jeffrey Croft wrote:
> $rc = system("/bin/tar cf foo.tar *")
>
> When tar fails, the value of $rc is zero. However, I can go to the shell
Which shell? system() is using /bin/sh. But if tar is failing, you should
see a non-zero value in $rc, unless there's a bug in your /bin/sh or in
perl. Good luck with it!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Mon, 15 Nov 1999 23:06:39 GMT
From: pacman@defiant.cqc.com (Alan Curry)
Subject: Re: Trying to use a variable as an operator
Message-Id: <3m0Y3.14103$YI2.672196@typ11.nn.bcandid.com>
In article <x73du7wfpi.fsf@home.sysarch.com>,
Uri Guttman <uri@sysarch.com> wrote:
>for ( qw( eval symrefs ) ) {
>
> ( $a_motto = $motto ) =~ s/FOO/$_/g ;
>
> print $a_motto ;
>}
Gee, I don't like that $a_motto variable. How might we name it more
appropriately...
$motto='Rewrite me without FOO before using FOO on your own';
for(qw/eval symrefs/) {
(${"${_}_motto"} = $motto) =~ s/FOO/$_/g;
eval "print \$${_}_motto";
}
--
Alan Curry |Declaration of | _../\. ./\.._ ____. ____.
pacman@cqc.com|bigotries (should| [ | | ] / _> / _>
--------------+save some time): | \__/ \__/ \___: \___:
Linux,vim,trn,GPL,zsh,qmail,^H | "Screw you guys, I'm going home" -- Cartman
------------------------------
Date: Mon, 15 Nov 1999 23:11:28 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Trying to use a variable as an operator
Message-Id: <s314p056hsq32@corp.supernews.com>
Scott Lanning (slanning@bu.edu) wrote:
: Tom Briles <sariq@texas.net> writes:
: > eval STRING is evil... eval STRING is evil...
:
: bah.. Like any judgement of good/evil, it depends on context.
: If eval() were evil in and of itself, then why did Larry Wall
: put it in Perl? Surely you're not claiming Larry was evil. :)
Larry, in His wisdom, set before us both evil and good, that we may
through His grace choose the good and be saved.
- Craig Berry, Perl Jesuit
--
| Craig Berry - cberry@cinenet.net
--*-- http://www.cinenet.net/users/cberry/home.html
| "They do not preach that their God will rouse them
a little before the nuts work loose." - Kipling
------------------------------
Date: 15 Nov 1999 18:12:13 -0500
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Trying to use a variable as an operator
Message-Id: <x7zowfuz76.fsf@home.sysarch.com>
>>>>> "AC" == Alan Curry <pacman@defiant.cqc.com> writes:
AC> $motto='Rewrite me without FOO before using FOO on your own';
AC> for(qw/eval symrefs/) {
AC> (${"${_}_motto"} = $motto) =~ s/FOO/$_/g;
AC> eval "print \$${_}_motto";
AC> }
a double pox on thee! may all your future coding be in python!
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page ----------- http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net ---------- http://www.northernlight.com
------------------------------
Date: 15 Nov 1999 20:00:07 -0500
From: Scott Lanning <slanning@bu.edu>
Subject: Re: Trying to use a variable as an operator
Message-Id: <kusaeoftfmw.fsf@strange.bu.edu>
pacman@defiant.cqc.com (Alan Curry) writes:
> $motto='Rewrite me without FOO before using FOO on your own';
> for(qw/eval symrefs/) {
> (${"${_}_motto"} = $motto) =~ s/FOO/$_/g;
> eval "print \$${_}_motto";
> }
heheheheh... Now that is E-VILL.
--
"One should not confuse this craving for change and novelty with the
indifference of play which is in its greatest levity at the same time
the most sublime and indeed the only true seriousness." --Georg Hegel
------------------------------
Date: Mon, 15 Nov 1999 15:53:47 -0800
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Unexpected error in array
Message-Id: <38309D0B.CE659A77@mail.cor.epa.gov>
Martin Foster wrote:
[MAJOR snip]
I'm sorry, but it isn't fair to expect anyone to review 650 lines
of code for you. Not without remuneration.
Please cut your code down to 30-40 lines which can still
reproduce your error. Then it will be reasonable to ask for
help in this newsgroup.
Thanks in advance,
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Mon, 15 Nov 1999 17:20:25 -0800
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Unload/reload modules?
Message-Id: <Pine.GSO.4.10.9911151716090.15797-100000@user2.teleport.com>
On Fri, 12 Nov 1999, Diemo Schwarz wrote:
> is it possible to unload and then reload a module from a running perl
> program?
No, not really. It's much like trying to give back memory to the system
after it's been allocated. You could do (as programs written in C and some
other languages do) and re-exec your own program, but that's generally not
worth it for Perl programs.
Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 16 Nov 1999 01:26:34 +0200
From: Re'em Bar <reembar@netvision.net.il>
Subject: Re: unwanted refresh with Apache server
Message-Id: <383096AA.7214DF93@netvision.net.il>
well, in the right place nobody knows, so I tried my luck.
anyway, nobody is forced to answer anything
--
Re'em
http://snark.co.il
------------------------------
Date: Tue, 16 Nov 1999 01:18:28 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: unwanted refresh with Apache server
Message-Id: <Eh2Y3.170$Va.4811@nsw.nnrp.telstra.net>
On Tue, 16 Nov 1999 01:26:34 +0200,
Re'em Bar <reembar@netvision.net.il> wrote:
> well, in the right place nobody knows, so I tried my luck.
> anyway, nobody is forced to answer anything
So, because no one answered my questions in rec.vegetables.lettuce,
I'll just ask my question here, on the off chance that someone knows.
*plonk* (1)
Martien
(1) Don't take it personally. I'm fine tuning my killfile, and you've
just been a great help to me.
--
Martien Verbruggen |
Interactive Media Division | Never hire a poor lawyer. Never buy
Commercial Dynamics Pty. Ltd. | from a rich salesperson.
NSW, Australia |
------------------------------
Date: Mon, 15 Nov 1999 17:22:28 -0800
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: unwanted refresh with Apache server
Message-Id: <3830B1D4.A6051FD3@mail.cor.epa.gov>
Re'em Bar wrote:
>
> well, in the right place nobody knows, so I tried my luck.
I'm really surprised to hear that. I would really expect a
better answer there than here.
> anyway, nobody is forced to answer anything
True, in theory. But when a thousand people a week have that
attitude, it makes this newsgroup an unhappy place to live.
That's why so many people have gotten on your case. Because
too many people do what you did, and ask here when they should
be asking elsewhere. This makes life difficult for people
who are browsing for relevant answers, and for people who are
just trying to give good advice on programming to querents.
And if you think I'm exaggerating about a thousand a week
who are asking in the wrong newsgroup, just check the numbers
yourself.
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Tue, 16 Nov 1999 08:38:00 +0800
From: Benjamin Gu <Benjamin_Gu@email.mot.com>
Subject: Where can i find more information on Schwartzian transform!
Message-Id: <3830A768.E9F8ECB5@email.mot.com>
Dear all, would like to show me
where i can find more information on
Schwartzian transform?
Regards
Benjamin
------------------------------
Date: 15 Nov 1999 20:31:35 -0500
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Where can i find more information on Schwartzian transform!
Message-Id: <x7u2mnusqw.fsf@home.sysarch.com>
>>>>> "BG" == Benjamin Gu <Benjamin_Gu@email.mot.com> writes:
BG> Dear all, would like to show me
BG> where i can find more information on
BG> Schwartzian transform?
have you tried searching deja for past references to it? or searching
www.perl.com? or searching the web (i doubt it will show many false
hits)?
at least 2 good articles exist which cover the ST, one by tom c. and the
other by yours truly and larry rosler. hint: my site might have it.
larry: (i know you will read this) should our article/sort pages link to
tom's article and other pages?
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page ----------- http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net ---------- http://www.northernlight.com
------------------------------
Date: Mon, 15 Nov 1999 19:19:18 -0500
From: Joe Kline <jkline@one.net>
To: avivA Starkman <aviva.starkman@exchange.sp.trw.com>
Subject: Re: Why perl won't print to STDOUT?
Message-Id: <3830A306.A2855857@one.net>
[ posted and mailed to poster ]
avivA Starkman wrote:
>
> Here's the situation:
> A csh script (dpc_script) invokes a second csh script (bist_core_flow)
> with a tee:
> bist_core_flow |& tee $DPC_SCRIPT_LOG
>
> Then the bist_core_flow script invokes a perl script:
> perl .rulea.pl ${DESIGN}
>
<SNIP>
> Two weird things:
> 1. Everything happens exactly the way I want it to if I remove the "|&
> tee
> $DPC_SCRIPT_LOG" from the dpc_script script.
Not being a shell guru, I'll take a stab at it:
The '&' puts the process in the background so the '...|&' goes into
the background and the 'tee' is just hanging out waiting for something
to happen.
> 2. When I comment out the line of perl that opens my input file, the
> prints
> happen without needing a carriage return.
Don't know about this bit.
joe
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Mon, 15 Nov 1999 17:11:44 -0800
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Why perl won't print to STDOUT?
Message-Id: <3830AF50.32052F7A@mail.cor.epa.gov>
avivA Starkman wrote:
>
> Here's the situation:
> A csh script (dpc_script) invokes a second csh script (bist_core_flow)
> with a tee:
> bist_core_flow |& tee $DPC_SCRIPT_LOG
>
> Then the bist_core_flow script invokes a perl script:
> perl .rulea.pl ${DESIGN}
>
> The perl script is supposed to open a file for input, print a few lines
> to STDOUT and read a response from STDIN. But for some reason, the
> screen remains blank until I press a carriage return. Then all the
> prints happen, AND the script interprets my carriage return as the
> response the script is looking for. Why??
Sounds like you're having buffering problems, either due to
your scripts or your Perl program or both. To learn how to
address Perl's buffering, look up the $| variable in the
perlvar pages:
perldoc perlvar
On another note, why oh why are you calling a Perl program
from a csh script from another csh script? Is this some
dinosaur you're not allowed to replace with a better-evolved
genus? Surely this would be a lot more straighforward if
written entirely in Perl...
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Mon, 15 Nov 1999 16:52:30 -0800
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Win32 module questions
Message-Id: <3830AACE.AD455101@mail.cor.epa.gov>
Mark Ruedy wrote:
>
> I am using Win32::Process::Create to run an external command.
>
> Is there a way to capture the output of the external command? Possibly
> using Win32::Console?
>
> Also, are there any good references for the subject of perls Win32 module?
Well, I wouldn't do this using Win32::Process . Read the
docs about the qx operator [also known as backticks].
If the docs which come with ActiveState Perl aren't adequate,
you might look at Dave Roth's book.
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Mon, 15 Nov 1999 17:41:38 -0800
From: "Mark Ruedy" <mruedy@alidian.com>
Subject: Re: Win32 module questions
Message-Id: <3830b536$0$206@nntp1.ba.best.com>
I need to use Win32::Process - or something other than open(CMD, "$mycmd
|"); or `mycmd` because
my command includes spaces and double quotes and for some reason this fails
on the newer version of perl.
It did work on a brain-dead version that was built for x86, but for the
win32 version the same external commands
fail miserably.
If not Win32::Process (which is the only way I have found so far to work),
then what other method do you have?
Here is an example of a command that I'm having trouble with:
C:\\program files\\VSS\\ss.exe Get \$/sw \"-VLLast Week\"
It's a source safe command that gives a really strange error (meaning that
ss.exe is not found) unless I remove one of the
parameters - "-VLLast Week". And again, this worked with a previous perl.
Thanks
David Cassell <cassell@mail.cor.epa.gov> wrote in message
news:3830AACE.AD455101@mail.cor.epa.gov...
> Mark Ruedy wrote:
> >
> > I am using Win32::Process::Create to run an external command.
> >
> > Is there a way to capture the output of the external command? Possibly
> > using Win32::Console?
> >
> > Also, are there any good references for the subject of perls Win32
module?
>
> Well, I wouldn't do this using Win32::Process . Read the
> docs about the qx operator [also known as backticks].
>
> If the docs which come with ActiveState Perl aren't adequate,
> you might look at Dave Roth's book.
>
> David
> --
> David Cassell, OAO cassell@mail.cor.epa.gov
> Senior computing specialist
> mathematical statistician
------------------------------
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 1390
**************************************