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 ______________________________________________________________________