in reply to Problems with open
What is happening is this: the open will open a pipe, fork, and the child will exec "garbage". On perls older than 5.6.0, open will return the pid - that is, it will return true if the fork succeeded.
Since 5.6.0, if you pipe open a simple program (one which doesn't require the shell to resolve special characters), and said program doesn't exist, the handling is special cased and the open itself will fail.
will not die, because Perl will fork and exec a shell (which will succeed), asking the shell to execute garbage * (which can't be done because "garbage" doesn't exist).open my $fh => "| garbage *" or die;
Abigail
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Problems with open
by skerr1 (Sexton) on Jul 24, 2002 at 15:07 UTC | |
by Abigail-II (Bishop) on Jul 24, 2002 at 15:20 UTC | |
by skerr1 (Sexton) on Jul 24, 2002 at 15:39 UTC | |
by Abigail-II (Bishop) on Jul 24, 2002 at 16:12 UTC | |
by skerr1 (Sexton) on Jul 24, 2002 at 16:35 UTC | |
by amphiplex (Monk) on Jul 24, 2002 at 16:05 UTC | |
by skerr1 (Sexton) on Jul 24, 2002 at 16:13 UTC |