develooper Front page | perl.perl5.porters | Postings from August 2009

Re: [perl #68312] perlop / list assignment documentation

Thread Previous | Thread Next
From:
Eirik Berg Hanssen
Date:
August 8, 2009 10:20
Subject:
Re: [perl #68312] perlop / list assignment documentation
Message ID:
7x8whu1awb.fsf@blackbox.eirik.dav
"ian.goodacre@xtra.co.nz (via RT)" <perlbug-followup@perl.org> writes:

> +If the left operand of the assignment operator is a list then the operator

  Please don't call the left operand a "list".  That is not just
misleading, but also risks propagating rather tough misconceptions.

  Consider: "is an array, a hash, a slice, or enclosed in parentheses".

  Consider: In the following, is f a list? a scalar? both?

use 5.010;
use strict;
use warnings;
my $x=1;
my $y=2;
sub f () :lvalue {
  $x, $y
}
say f;
f=4;
say f;
f=(5,6);
say f
__END__
Useless use of a constant in void context at - line 12.
12
14
16


Eirik
-- 
Flon's Law:
        There is not now, and never will be, a language in which it is
        the least bit difficult to write bad programs.

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