in reply to Split results of Map function
I'm inferring that by "second pair of numbers" you mean "the second number in each pair of numbers".
orwhile (<DATA>) # or wherever those lines come from { chomp; my( $num, $str ) = split ' ', $_, 2; $str =~ s/^\d+,\s*//; $hash{$num} = $str; }
while (<DATA>) # or wherever those lines come from { /^(\d+)\s+\d+,\s*(.*)/ and $hash{$1} = $2; }
|
|---|