in reply to Reality checking a win32 perl bug
Wild guess: in both your examples you die in any case. This means that the program terminates with an exit value that is not null, i.e. technically, it fails. That is, it may not be an error, but exactly what is supposed to happen. Have you tried s/die/print/?
What are you really trying to achieve? What did you expect to happen?
perl -e "sub { @_ = sub {@_}->(@_); fork ? die 5 : die 6 }->(2)"
Hmmm... here you dereference a subref passing in 2 as an arg. Then you pass the whole argument list, that is (2), to another anonymous sub that will just return its arguments, and assign that back to the argument list, which is not changed after all. Having done all this you don't do anything with the input value, but simply fork and die both if you're the "forked" process or the parent one - or if the fork failed.
perl -e "sub { @_ = 3; fork ? die 5 : die 6 }->()"
Less byzantine, but still @_ = 3; does nothing, really.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Reality checking a win32 perl bug
by xdg (Monsignor) on May 16, 2006 at 11:26 UTC |