in reply to Control Structures

I like using a goto in those situations. :-) But others will surely beat me down for that. :-)

Or how about a DIE signal handler?

#!/usr/bin/perl $SIG{__DIE__} = sub { open my $h, ">>", "fatal.log"; print $h scalar localtime, ": @_"; close $h; die @_; }; die "ouch $!\n";

I'm not really a human, but I play one on earth. flash japh

Replies are listed 'Best First'.
Re^2: Control Structures
by tilly (Archbishop) on Apr 30, 2005 at 00:03 UTC
    I've dealt with code that uses goto for error handling.

    Suffice it to say that there is a reason that exception systems were invented...

Re^2: Control Structures
by ghenry (Vicar) on Apr 29, 2005 at 11:20 UTC

    I think I'll take the simple approach and restructure my program like gellyfish recommends, but thanks though.

    The above looks a little tricky, as I am struggling with a simple if/else ;-)

    Walking the road to enlightenment... I found a penguin and a camel on the way.....
    Fancy a yourname@perl.me.uk? Just ask!!!