At 10:20 AM 8/27/00 -0400, Bennett Todd wrote:
>I'd usually rather just say
>
> my $fh = open $filename;
>
>and be done with it, but then I'd always "use Fatal qw(:all);". But
>if I'd done such a "use Fatal", and then wanted to catch one, I sure
>hope I wouldn't have such a rabid try/catch bru-ha-ha inflicted on
>me; couldn't I just say
>
> my $fh = eval { open $filename } or whatever ...;
>
>die/eval works really sweetly; I haven't figured out why people
>want to replace eval { BLOCK } with try/catch. If you want more
>structured data in the exception, make $! an arbitrary complex
>object that stringifies to the text message.
We're proposing exactly that. RFC 88 refers to $@ as that variable; RFC
151 proposes merging $@ into $!. And eval BLOCK should work exactly the
same way in Perl 6 as it does now, so you will indeed be able to do what
you propose. (This is my position and RFC 88's position, but there are
disagreements.)
(Nearly) everrrybuddy heppy :-)
--
Peter Scott
Pacific Systems Design Technologies