Yep! That's the entire output. I've added a couple of print $]; statements, one in an END{} block, to these to show that I get some output, which means that STDOUT must be being flushed, which I assume is a clean-up time operation:
P:\test>perl -l
END{ print $] }
print $];
use strict;
use warnings;
my $x="";
foo( substr($x,2,1) ); # crashes here
print "Alive!\n"; # not reached
sub foo {}
^Z
5.008004
substr outside of string at - line 6.
5.008004
P:\test>c:\perl561\bin\perl5.6.1.exe -l
END{ print $] }
print $];
use strict;
use warnings;
my $x="";
foo( substr($x,2,1) ); # crashes here
print "Alive!\n"; # not reached
sub foo {}
^Z
5.006001
substr outside of string at - line 6.
5.006001
P:\test>
However, if I remove the subcall from the picture:
P:\test>perl
use strict;
use warnings;
my $x="";
print substr($x,2,1); # crashes here
print "Alive!\n"; # not reached
^Z
substr outside of string at - line 4.
Use of uninitialized value in print at - line 4.
Alive!
P:\test>c:\perl561\bin\perl5.6.1.exe
use strict;
use warnings;
my $x="";
print substr($x,2,1); # crashes here
print "Alive!\n"; # not reached
^Z
substr outside of string at - line 4.
Use of uninitialized value in print at - line 4.
Alive!
P:\test>
Which indicates that the execution path is being truncated or short ciruited when the subcall is in place, but no crash, just a silent move to the END{} of the program--which isn't very freindly.
Seems to be a Win32 thing, and one probably worth reporting even though I cannot see how to provide any sort of indication of where the problem might occur?
Examine what is said, not who speaks.
Silence betokens consent.
Love the truth but pardon error.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Outside of code tags, you may need to use entities for some characters:
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
|
|