develooper Front page | perl.perl5.porters | Postings from May 2013

Re: [perl #117947] all XS functions are implicitly :lvalue

Thread Previous | Thread Next
From:
Rafael Garcia-Suarez
Date:
May 13, 2013 11:28
Subject:
Re: [perl #117947] all XS functions are implicitly :lvalue
Message ID:
CAMoYMM8+yb-gXOGRNeMaRjxA1kPXatKQRcOvLnVUDX7bSdQ_aw@mail.gmail.com
On 10 May 2013 17:59, l.mai@web.de <perlbug-followup@perl.org> wrote:
> The following problem was found by yko (Yaroslav Korshak):
>
> % perl -wle 'use List::Util qw(maxstr); List::Util->maxstr($_ = "hi") = 42; print'
> 42

maxstr is not a method; if you use List::Util::maxstr() instead, it
complains as it should:

~ยง perl -wle 'use List::Util qw(maxstr); List::Util::maxstr($_ = "hi")
= 42; print'
Can't modify non-lvalue subroutine call in scalar assignment at -e
line 1, near "42;"
Execution of -e aborted due to compilation errors.

That said, we actually seem to have a problem with XS functions called
as methods.

Thread Previous | Thread Next


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