[27062] in Perl-Users-Digest
Perl-Users Digest, Issue: 8965 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Feb 17 00:05:46 2006
Date: Thu, 16 Feb 2006 21:05:04 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Thu, 16 Feb 2006 Volume: 10 Number: 8965
Today's topics:
Re: Combining three arrays of hashes into one? <matthew.garrish@sympatico.ca>
Re: Combining three arrays of hashes into one? robic0
Inconsistent returns from piped open <fishfry@your-mailbox.com>
Re: Inconsistent returns from piped open xhoster@gmail.com
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 16 Feb 2006 21:32:53 -0500
From: "Matt Garrish" <matthew.garrish@sympatico.ca>
Subject: Re: Combining three arrays of hashes into one?
Message-Id: <jBaJf.42410$T35.689396@news20.bellglobal.com>
"Keith Lee" <cmarvel@nethere.com> wrote in message
news:pan.2006.02.17.01.45.45.152421@nethere.com...
> All:
> Is there a way of copying three arrays of hashes into one array for
> future sorting? Thanks!
>
@d = (@a, @b, @c)
Or do you mean something else?
Matt
------------------------------
Date: Thu, 16 Feb 2006 18:56:05 -0800
From: robic0
Subject: Re: Combining three arrays of hashes into one?
Message-Id: <eneav1hl3j2tbpkmlks7va0ru7m75uipof@4ax.com>
On Thu, 16 Feb 2006 17:45:45 -0800, Keith Lee <cmarvel@nethere.com> wrote:
>All:
> Is there a way of copying three arrays of hashes into one array for
> future sorting? Thanks!
>
>Keith
Lookout, I'm asking you post an example to coincode with your what
ever bullshit question/without example you are posting!
------------------------------
Date: Thu, 16 Feb 2006 20:10:01 -0800
From: fishfry <fishfry@your-mailbox.com>
Subject: Inconsistent returns from piped open
Message-Id: <fishfry-2412D0.20100116022006@comcast.dca.giganews.com>
#!/usr/bin/perl
use strict;
# 1. The open() call returns false.
my $x = open(XX, "| junk");
print "x = $x\n";
# 2. The open() call returns true.
my $y = open(YY, "| junk > foozle");
print "y = $y\n";
When the above code is run (on a Unix system), $x has a value of 0, and
$y has a nonzero value.
junk is a non-existent executable. It's correct for the open() to fail,
since the process creation failed.
However, adding an output redirect causes open() to return a nonzero
value.
This is causing me a problem, since I need to know if the process
creation failed.
Any explanation for why the second example returns true? And perhaps an
alternate way to do the same thing so I can find out if the process
creation fails?
------------------------------
Date: 17 Feb 2006 04:30:01 GMT
From: xhoster@gmail.com
Subject: Re: Inconsistent returns from piped open
Message-Id: <20060216233124.621$mN@newsreader.com>
fishfry <fishfry@your-mailbox.com> wrote:
> #!/usr/bin/perl
> use strict;
>
> # 1. The open() call returns false.
> my $x = open(XX, "| junk");
> print "x = $x\n";
Perl tries to execute junk. It fails.
> # 2. The open() call returns true.
> my $y = open(YY, "| junk > foozle");
> print "y = $y\n";
This contains shell metacharacters, so perl tries to start
up a shell. It succeeds, and returns the pid of the shell it
started. The shell turns around and tries to execute junk, and of
course it fails. But the shell's failure is not perl's failure.
>
> When the above code is run (on a Unix system), $x has a value of 0, and
> $y has a nonzero value.
>
> junk is a non-existent executable. It's correct for the open() to fail,
> since the process creation failed.
>
> However, adding an output redirect causes open() to return a nonzero
> value.
>
> This is causing me a problem, since I need to know if the process
> creation failed.
You do know that. It is just that that is not what you really want
to know.
>
> Any explanation for why the second example returns true? And perhaps an
> alternate way to do the same thing so I can find out if the process
> creation fails?
You will be notified of this problem via a SIGPIPE or by the close of
the piped filehandle failing (plus by the shell's whining on STDERR).
If that isn't sufficient, then I don't know--maybe perldoc perlipc has
something useful to say on the matter.
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
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 V10 Issue 8965
***************************************