Something like:
use strict; use warnings; my @arrofIndices = (1, 3); my $str = 'Zeroth|First|Second|Third'; my $prodKey = join "|", (split /\|/, $str)[@arrofIndices]; print $prodKey
Prints:
First|Third
In reply to Re: Construct Key by split
by GrandFather
in thread Construct Key by split
by libvenus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |