in reply to Re: pass code block to function (PROTOTYPES)
in thread pass code block to function (PROTOTYPES)
thnx!#! /usr/bin/perl use strict ; use warnings ; sub try (&@) { my($try,$catch) = @_; eval { &$try }; if ($@) { $catch; } } sub catch (&) { &{$_[0]} } try { die "phooey"; } catch { print "unphooey\n"; }; catch { print "test\n"; } ;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: pass code block to function (PROTOTYPES)
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 |