in reply to perl crashes parsing huge script - how to find a line that crashes it?

An old standby. Insert lines like the following:
BEGIN {print "Still alive at " . __LINE__ . "\n"}
and then do a binary search to find where it dies.

When you find it, you will likely have to figure out why it is dying. It may well be due to a bug in Perl 5.10. Do not discount the value of trying to come up with the shortest program you can that crashes. Even if that program is meaningless to you, you can submit it as a bug report and someone else can try to fix it. Even more usefully though, you are likely to learn enough about the problem to figure out how to work around the bug.

Good luck! (And hopefully you do not need to work with much of this previous programmer's code. 6mb and uses no modules???)

  • Comment on Re: perl crashes parsing huge script - how to find a line that crashes it?
  • Download Code

Replies are listed 'Best First'.
Re^2: perl crashes parsing huge script - how to find a line that crashes it?
by John M. Dlugosz (Monsignor) on Feb 20, 2008 at 00:52 UTC
    I second that.

    Another idea would be to truncate the file and see if it doesn't crash. Do a binary search that way. Hopefully, using __END__ will do the trick. Or, use editor's undo feature.