![]() |
| |||
| The meaning of $^S seems to have changed from perl 5.6.0 to perl 5.8.0. There is mention in the Changes files of it being broken prior to perl 5.8.0, but if so, I no longer understand how it is supposed to work. Take this module: ----------- package T; print '$^S is ', defined $^S ? "defined: '$^S'\n" : "not defined\n"; 1; ----------- With perl 560 I get these (sensible to me) results: $ perl560 T.pm $^S is defined: '0' $ perl560 -MT -e 1 $^S is not defined But with perl 588, I get this: $ perl588 T.pm $^S is defined: '0' $ perl588 -MT -e 1 $^S is defined: '1' The man page for $^S says this: "$^S $EXCEPTIONS_BEING_CAUGHT Current state of the interpreter. $^S State --------- ------------------- undef Parsing module/eval true (1) Executing an eval false (0) Otherwise The first state may happen in $SIG{__DIE__} and $SIG{__WARN__} handlers." It would seem to me that in the -MT case, the module is in fact being "parsed", which would mean that $^S should be undef. For $^S to be 1, it should be "executing an eval", which I don't believe -MT is doing. In other words, the 560 behavior looks more correct to me than the 588 behavior. What am I missing here? John. |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |