![]() |
|
Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re^11: How to find perl line after segfault.by BrowserUk (Patriarch) |
on Feb 15, 2015 at 21:05 UTC ( #1116816=note: print w/replies, xml ) | Need Help?? |
Well, with open3(), I can use waitpid and then read (error); which allows me some control over what happens next, if I just did system ("perl -d:CallTrace Foo.pl"); Wouldn't it just crash? It will crash either way, the only differences is that with Re: Catching errors (II)., you can get the error code (and, on *nix at least, the 'signal value'); and then read the output from stderr. If you use my suggested system q[perl -d:CallTrace Foo.pl 2>trace.txt];, then you can also read back the stderr output, by reading the file. You're also more likely to get the last few lines, because you won't have the double-buffering effect you get when you use pipes. Also, if the exit code is important to you, then (from perldoc perlfunc system ):
With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
I'm with torvalds on this
In the absence of evidence, opinion is indistinguishable from prejudice. Agile (and TDD) debunked
In Section
Seekers of Perl Wisdom
|
|