in reply to Prototypes and hand-written MMD
The interesting thing about "&" is that you can generate new syntax with it, provided it's in the initial position:Although I'm not quite sure it would work.sub try (&@) { my($try,$catch) = @_; eval { &$try }; if ($@) { local $_ = $@; &$catch; } } sub catch (&) { $_[0] } try { die "phooey"; } catch { /phooey/ and print "unphooey\n"; };
update: 2006-01-10 00:06:08 PST The prototype magic that allows you to avoid a comma only works with codeblocks (just like do/grep/map), so I'm pretty sure now that you can't avoid it.
|
|---|