Kageneko has asked for the wisdom of the Perl Monks concerning the following question:
I wonder if I am misreading something, but I believe I have found a bug in Carp. My development group regularly uses exit status to report error conditions to parent programs. This is because we do TN3270 screen scraping and certain conditions (host timeout, connection refused, etc.) cause an automatic restart of the programs. When we began moving our programs to perl, the restarting stopped working. After some searching, I found the problem was Carp. I have found this problem in both 5.6.1 and 5.8.1.
Compare the two snippets and their outputs.
#!/appl/cpc/bin/perl -w use strict; use warnings; $! = 10; $? = 9; die "$!: $?";
xxx:xxx/xxx/xxx> perl5.8.1 test.pl; echo $?
No child processes: 9 at test.pl line 7.
10
#!/appl/cpc/bin/perl -w use strict; use warnings; use Carp; $!=10; $?=9; croak "$!: $?";
xxx:/xxx/xxx/xxx> perl5.8.1 test.pl; echo $?
No child processes: 9 at test.pl line 9
255
{ local $@; require Carp::Heavy; } # XXX fix require to not clear $ +@?
But those suspicions are mostly because I have no clue and am grasping at anything that looks vaguely weird. Is this a valid bug to report or am I missing something?
For reference, this is compiled for 'HP-UX B.11.00 E'. I can post the 'perl -V' if necessary.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Bug with Carp and $!/$?
by halley (Prior) on Jul 10, 2003 at 17:14 UTC | |
|
Re: Bug with Carp and $!/$?
by tilly (Archbishop) on Jul 10, 2003 at 17:30 UTC | |
by Kageneko (Scribe) on Jul 10, 2003 at 17:43 UTC | |
|
Re: Bug with Carp and $!/$?
by Kageneko (Scribe) on Jul 10, 2003 at 17:37 UTC | |
|
Re: Bug with Carp and $!/$?
by Anonymous Monk on Jul 10, 2003 at 17:22 UTC | |
by Kageneko (Scribe) on Jul 10, 2003 at 17:34 UTC | |
|
Re: Bug with Carp and $!/$?
by tilly (Archbishop) on Jul 14, 2003 at 01:14 UTC |