in reply to How do I get a post mortem stack trace?
Here, just make the sub main() be what would normally be the program block outside of any function call, i.e. heres how to turn hello world into what i'm saying# beginning of program eval { main(); }; if ( $@ ) { confess(); } sub main { ... }
Trivial example, this should never die, if it does, you have bigger problems.#!/usr/bin/perl -w use strict; use Carp; eval { main(); }; if ( $@ ) { confess(); } exit; sub main { print "hello world\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: How do I get a post mortem stack trace?
by rinceWind (Monsignor) on Nov 11, 2002 at 16:31 UTC |