develooper Front page | perl.perl5.porters | Postings from November 2000

Repeating undef in list assignment

Thread Next
Peter Scott
November 13, 2000 17:48
Repeating undef in list assignment
Message ID:
Why shouldn't this be allowed:

$ perl -wle 'sub foo{(4,5,6)};((undef)x2, $x) = foo; print $x'
Can't modify repeat (x) in list assignment at -e line 1, near "foo;"
Execution of -e aborted due to compilation errors.

What makes it different from this:

$ perl -wle 'sub foo{(4,5,6)};(undef,undef, $x) = foo; print $x'

Peter Scott
Pacific Systems Design Technologies

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About