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

[perl #3471] Targeting printf %n format at any lvalue, not just scalar variable

From:
Father Chrysostomos via RT
Date:
January 19, 2012 23:01
Subject:
[perl #3471] Targeting printf %n format at any lvalue, not just scalar variable
Message ID:
rt-3.6.HEAD-14510-1327042893-1359.3471-15-0@perl.org
On Fri Jul 07 23:34:16 2000, RT_System wrote:
> >And as I different variation, I can't get lvalue subs to work at all:
> 
> >  DB<1> sub lv:lvalue { $x }
> 
> >  DB<2> $x = 3
> 
> >  DB<3> x lv()
> >0  3
> >  DB<4> x lv = 4
> >0  4
> >  DB<5> x $x
> >0  3
> >  DB<6>
> 
> >That's using perl-current.
> 
> It's a debugger issue.  Your code, run stand-alone:
> 
>     #!/usr/bin/perl -l
>     sub lv:lvalue { $x }
>     $x = 3;
>     print lv;
>     lv = 4;
>     print $x;
> 
> Does produce the expected result:
> 
>     3
>     4
> 
> >Have lvalue subs ever worked?
> 
> Yes.

And it works in the debugger in 5.10.1, but not 5.10.0.

-- 

Father Chrysostomos


---
via perlbug:  queue: perl5 status: open
https://rt.perl.org:443/rt3/Ticket/Display.html?id=3471



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About