in reply to Re: substr oddity
in thread Perl oddities
Well, I'm running version "5.8.6 built for PA-RISC2.0-thread-multi-LP64", running on HP/UX. I also get the same behaviour for 5.6.1.
But your snippet doesn't actually demonstrate the problem: you get the warning message, but can't actually detect whether the code crashed. Here's what I get when I add a trace statement after the call to substr().
Note that "not reached" is never reached, and is not printed, because the code crashes on the substr() call.$ perl -wle 'sub foo{}; my $s=""; foo( substr($s,2,1) );print "Not rea +ched\n"' substr outside of string at -e line 1. $
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: substr oddity
by BrowserUk (Patriarch) on Mar 04, 2005 at 18:24 UTC | |
by Anonymous Monk on Mar 04, 2005 at 19:05 UTC | |
by BrowserUk (Patriarch) on Mar 04, 2005 at 19:28 UTC | |
by Anonymous Monk on Mar 04, 2005 at 23:12 UTC | |
by BrowserUk (Patriarch) on Mar 04, 2005 at 23:55 UTC | |
|