develooper Front page | perl.perl5.porters | Postings from January 2015

[perl #123218] Setting $/ to a FOO reference is only half forbidden

Tony Cook via RT
January 28, 2015 05:47
[perl #123218] Setting $/ to a FOO reference is only half forbidden
Message ID:
On Sun Nov 16 04:47:05 2014, wrote:
> On Sat, 15 Nov 2014 16:37:31 -0800
> Father Chrysostomos (via RT) <> wrote:
> > It croaks, but the assignment happens anyway, because the croak is
> > too late.  Either this should be a warning, or we should arrange for
> > the previous value of $/ to be preserved.
> Isn't this just what 'set' magic does though? It can't prevent the
> assignment happening, because it's invoked afterwards. It just observes
> the effect once it has.
> Having the 'set' magic store the previous value and restore it on bad
> assignments before croaking could be easy enough though; seems nicer
> than downgrading it to a warning that still leads to broken behaviour.

The valued used by the interpreter is stored in PL_rs, we can just return that in Perl_get_magic().


via perlbug:  queue: perl5 status: open Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About