#!/usr/bin/perl -w use strict; my @array = qw(0 1 2 3 4 5 6 7 8); print join '_' , grep length, map {$array[$_] if $_ % 2 == 1} (0 .. $# +array);
Cheers - L~R
Update: If you know the number of elements in the array, don't use this method - use BrowserUk's solution
In reply to Re: selective join
by Limbic~Region
in thread selective join
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |