more useful options | |
PerlMonks |
Re^4: Help with arraysby fluffyvoidwarrior (Monk) |
on Sep 22, 2012 at 05:01 UTC ( [id://995039]=note: print w/replies, xml ) | Need Help?? |
Perl is a pretty much untyped, dynamic language. When declaring an array in Perl you don't need to specify how big you intend it to be or what it contains. It will expand and shrink at runtime depending what you do with it. I imagine the problem is aimed at illustrating this and ensuring that you know how to handle it. So, all arrays are of unknown length unless you know what you put in them or you find out with: $size = @nums; or $last_index = $#nums
In Section
Seekers of Perl Wisdom
|
|