Re: Fundamental pipe questions
- From: "Lost Sheep Of the Porn" <cdalten@xxxxxxxxx>
- Date: 30 Mar 2007 18:20:04 -0700
On Mar 30, 11:56 am, "Peter J. Holzer" <hjp-usen...@xxxxxx> wrote:
["Followup-To:" header set to comp.lang.perl.misc.]
On 2007-03-30 14:00, grocery_stocker <cdal...@xxxxxxxxx> wrote:
What's the difference between
open(FOO, "│tr ’[a-z]’ ’[A-Z]’");
How did you manage that? "│" is not a pipe ("|" is) and "’" is not a
single quote ("'" is). So that code will indeed not invoke a shell,
instead it will try to open the file "│tr ’[a-z]’ ’[A-Z]’" for reading.
But I'll assume that the strange characters were introduced by your
browser or google and that your real code does contain a pipe character
and single quotes.
and
open(FOO, ’│-’, "tr ’[a-z]’ ’[A-Z]’");
None.
If both constructs are the same, then how come perlipc rattles about
|-. I think the following section from perlipc comes to mind
And here’s a safe pipe open for writing:
# add error processing as above
$pid = open(KID_TO_WRITE, "|-");
$SIG{PIPE} = sub { die "whoops, $program pipe broke" };
if ($pid) { # parent
for (@data) {
print KID_TO_WRITE;
}
close(KID_TO_WRITE) || warn "kid exited $?";
} else { # child
($EUID, $EGID) = ($UID, $GID);
exec($program, @options, @args)
|| die "can’t exec program: $!";
# NOTREACHED
}
.
- Prev by Date: Re: hash referrences and such
- Next by Date: Re: HELP! Perl&CGI problem
- Previous by thread: Regexp non-alphanumerics to spaces
- Next by thread: Re: HELP! Perl&CGI problem
- Index(es):
Relevant Pages
|
|