#!/usr/bin/perl use strict; no warnings; my (@firstkey, @numberofkeys); my @list = qw /foo housekey blah carkey baz monkey/; @firstkey [0] = grep {/key$/} @list; $numberofkeys [0] = grep {/key$/} @list; print "@firstkey\n"; print "@numberofkeys\n"; __END__ housekey 3
And yes, there are a million different ways to write this code, but that's not the point.
But I can't think of a case where using @array [0] in non-lvalue context could return something else than $array [0].
Abigail
In reply to Re: @array[1] is valid??
by Abigail-II
in thread @array[1] is valid??
by jdklueber
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |