This takes advantage of the fact that $ARGV contains the file name.perl -ne "$small||=$ARGV; $small eq $ARGV? $h{$_}++: $h{$_}?0:print" s +mall.txt large.txt
Use single-quotes if you run in *nix.
"I'm fairly sure if they took porn off the Internet, there'd only be one website left, and it'd be called 'Bring Back the Porn!'"
-- Dr. Cox, Scrubs
In reply to Re: a one-liner for this trivial problem?
by NetWallah
in thread a one-liner for this trivial problem?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |