[Chicago-talk] Using "@" to reference element in array
kent at c2group.net
Thu Oct 1 15:00:59 PDT 2009
On Oct 1, 2009, at 4:42 PM, Jay Strauss wrote:
> I just got a script at work where the writer used:
> my @array = qw[adf af a adf asdfd];
> print @array;
> And it works!!
You must not have warnings turned on.
@array[ @indices ] is a valid way to produce a slice of array values,
but when there's only one index, the @ sigil doesn't make much sense.
And when you have warnings turned on, perl tells you that it doesn't
Scalar value @array better written as $array at <filename> line
Kent Cowgill kent at c2group.net
More information about the Chicago-talk