in reply to a one-liner for this trivial problem?
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: a one-liner for this trivial problem?
by space_monk (Chaplain) on Apr 17, 2013 at 04:22 UTC |