Crossposted to
StackOverflow. Crossposting isn't bad, but it's considered polite to inform about crossposting to prevent unnecessary work: people not attending both sites might spend a lot of time solving a problem already solved at the other end of the internets.
map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]