in reply to Re: Re: Need counter assistance
in thread Need counter assistance
For example, you could have just said
and $ct would have been set correctly, because that assignment is a scalar context, and in a scalar context an array or list returns its number of elements.my $ct=@files;
Since "print" is a list context, I had to use the "scalar" operator to get the count of elements rather than the list of values.
Check out "perldoc -f scalar" and "perldoc perldata" for more information.
--
Mike
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: Need counter assistance
by Anonymous Monk on Aug 30, 2002 at 14:01 UTC |