On 05/16/2012 07:46 AM, damien krotkine wrote:
> Hi all,
>
> thanks for the quick answers :)
>
> first of all, despite my attempt to clear things up with an example, I
> failed :) What I wante is "every other element, beginning with the
> first", so :
>
> ( 'foo', 3, 42, 'bar) should become ( 'foo', 42).
If you don't care about order, but just want those elements, you can
also do:
keys%{{@a}}
{@a} being a hash ref constructed from @a
%{ } dereferencing that hash ref
keys pulling out the keys, ie. the odd elements of the orig. list
hth,
Mike
Thread Previous
|
Thread Next