[Chicago-talk] Using "@" to reference element in array
me at heyjay.com
Thu Oct 1 19:53:30 PDT 2009
You are right. I don't have warnings turned on. I was just looking over
his script. (normally I use warnings)
On Thu, Oct 1, 2009 at 5:00 PM, Kent Cowgill <kent at c2group.net> wrote:
> 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 make sense:
> Scalar value @array better written as $array at <filename> line <blah
> Kent Cowgill kent at c2group.net
> http://kentcowgill.org/blog http://youtube.com/kcowgill
> http://kentcowgill.org/photos http://flickr.com/people/kcowgill
> Chicago-talk mailing list
> Chicago-talk at pm.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Chicago-talk