Nice! Interestingly, for this input, the pure Perl solution if faster than my PDL one. But if you make the matrices larger, e.g. already 3x5 and 4x5 makes PDL the fastest, as it scales the best.
map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]