RE: Safe list assignment

[email protected] ("Ed Avis")
Newsgroups perl.beginners
Message-ID <[email protected]>
>No. if @array includes 3 elements, all statements below are 
>right in Perl:
>
>my ($a) = @array;
>my ($a,$b) = @array;
>my ($a,$b,$c) = @array;
>my ($a,$b,$c,$d) = @array;

Yes, my question is whether a 'checked' assignment, raising an error if there are the wrong number of elements in the RHS array for the number of slots in the LHS, is available in Perl.  Perhaps there is some CPAN module that provides a convenient syntax, or another idiom that can be used.

-- 
Ed Avis <[email protected]> 

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.