Re: Rationale for $!
[email protected] (Moritz Lenz) Wed, 27 Jan 2016 13:15:46 +0100
| Newsgroups | perl.perl6.language |
|---|---|
| Message-ID | <[email protected]> |
Hi, On 01/27/2016 07:17 AM, Felipe Gasper wrote: > Hello, > > What is the purpose of having $! in Perl 6? > > The global variables in Perl 5 are a constant headache, prompting > us to need to local()ize variables like $@, $!, and $? to avoid > unforeseen consequences like RT #127386 and those documented in > Try::Tiny’s POD. > > Perl 6 seems to give us both the “right” and the “wrong” solution > to accessing exception variables: we get $_ within a CATCH block > (right), but we also get that global $!--which, to me, seems > pathologically wrong. But it's not global! None of $_, $/, $! are global. Cheers, Moritz