while ( ) { chomp; my( $label, $index, $value ) = ( split /\s+/ )[3, 5, -1]; $a_vals[ $index ] = $value; $b_vals[ $index ] = $value; }