- or download this
my @fields = ( split /\s+/ ); # need to hold on to all field
+s for later
my( $index, $label ) = @fields[4, -1]; # this is an array slice
- or download this
use 5.010;
...
when ( 'B' ) { $fields[ -2 ] = $y; }
default { say "OOPS! bad label"; }
}
- or download this
say join "\t", @fields; # separates fields with TAB