XP is just a number | |
PerlMonks |
Re: Simple array questionby Roger (Parson) |
on Dec 23, 2003 at 01:01 UTC ( [id://316543]=note: print w/replies, xml ) | Need Help?? |
I just want to add why you are printing the value of '1', other monks have already pointed out a fix to your problem. Your code, print length(@attrvals); is equivalent to print length( scalar @attrvals );, which is equivalent to print length("2"), which prints "1", the length of string "2". Run the demo code below - The output is 3, since the string "100" (elements) has 3 characters.
In Section
Seekers of Perl Wisdom
|
|