jeanluca has asked for the wisdom of the Perl Monks concerning the following question:
Any suggestion why it doesn't print "unphooey again" ?#! /usr/bin/perl -l sub try (&@) { my($try,$catch) = @_; eval { &$try }; if ($@) { local $_ = $@; &$catch; } } sub catch (&) { $_[0] } try { die "phooey"; } catch { /phooey/ and print "unphooey\n"; }; # my test code catch { print "unphooey again\n"; } ; __END__ output: unphooey
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: pass code block to function (PROTOTYPES)
by JavaFan (Canon) on Jul 15, 2009 at 10:20 UTC | |
by jeanluca (Deacon) on Jul 15, 2009 at 10:34 UTC | |
by JavaFan (Canon) on Jul 15, 2009 at 10:40 UTC | |
by jeanluca (Deacon) on Jul 15, 2009 at 12:05 UTC | |
by JavaFan (Canon) on Jul 15, 2009 at 13:04 UTC | |
|
Re: pass code block to function (PROTOTYPES)
by LanX (Saint) on Jul 15, 2009 at 14:26 UTC | |
by Corion (Patriarch) on Jul 15, 2009 at 14:34 UTC | |
|
Re: pass code block to function (PROTOTYPES)
by Corion (Patriarch) on Jul 15, 2009 at 10:10 UTC |