#instead of $one_match_ref->[3] = $1; $one_match_ref->[4] = $2; $one_match_ref->[5] = $3; #use push( @{one_match_ref},$1,$2,$3 );