Garayed.com  

Go Back   Garayed.com > Perl
FAQ Members List Calendar Search Today's Posts Mark Forums Read


Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-11-2006, 04:20 PM
allenjo5@mail.northgrum.com
 
Posts: n/a
Default meaning of $^S

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.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 10:27 AM.




LinkBacks Enabled by vBSEO 3.0.0 © 2007, Crawlability, Inc.