You wrote my $length=length(@list); and this is completely wrong. You should have written my $length = @list; instead. Here's what you got: length() puts its argument in scalar context and evaluates it as a string. An array in scalar context returns the number of elements it contains. A number that's used like a string is converted to a string. length() returns the number of characters in its string. So if you had ten elements in the list, you were doing the equivalent of length("10") which is 2.
⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊
In reply to Re: Source Grabber
by diotalevi
in thread Source Grabber
by Andrew_Levenson
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |