in reply to There has to be an easier way...
Or, using array slices:my $data = "f1|f2|f3|f4|f5"; my @data = split /|/, $data; print $data[2], "\n"; # prints f3, of course- arrays start on 0.
Fun fun fun...my $data = "f1|f2|f3|f4|f5"; my ($clliA, $clliZ) = (split /|/, $d)[1,3]; # $clliA = "f2" # $clliZ = "f4"
Alan
update: Yikes, everyone beat me to it... oops.
|
|---|