in reply to readline must affect/apply in Perl <STDIN>

Crossposted to Unix StackExchange.

It's considered polite to inform about crossposting, so that people not attending both sites don't waste their efforts 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]