2 ms·
Interesting, I hadn't thought much about the zero length case. I'd change the perl example, though, so it's easier to read. Maybe: $ printf "foo\nbar\n" | p
by tyingq 5y ago
Interesting, I hadn't thought much about the zero length case.
I'd change the perl example, though, so it's easier to read. Maybe:
$ printf "foo\nbar\n" | perl -ne 'print if //'
or
$ perl -e 'print "yes\n" if "bar" =~ //'