in reply to Passing Any Range of Values to a Sub
Hi there.
I'm also a student learning the language.
Personally, I think it's best to always use:
my $size = scalar(@testarr);
rather than:
my $size = @testarr;
Because it's easier to understand and by naming something you exert a little more control over it. It also helps stress the difference between scalars and arrays, which is helpful for me as a student.
I'd be interested in knowing what the more established users of the language think about using scalar() rather than using only the array.
Any comments?
David Caughell.
Barrie, Ontario, Canada.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Passing Any Range of Values to a Sub
by chromatic (Archbishop) on Jul 02, 2003 at 05:53 UTC | |
by David Caughell (Monk) on Jul 06, 2003 at 06:38 UTC |