in reply to Re: The problem with one-liners...
in thread The problem with one-liners...
Oh well, a little fiddling since it's such fun stuff:
Which leads me to a head-tail (useful eg, for finding out the range of a log file).
  p
-> perl -pe '$\=$_}{' file# Last line of a file perl -pe '$*=$_}{$_=$*' file
Which leads me to a head-tail (useful eg, for finding out the range of a log file).
and (not stopping while he's ahead) . . .perl -pe '$*||=$_; $\=$_}{$_=$*' file
-> perl -pe '/foo/...last' file# Exit after first match perl -ne 'print; last if /foo/' file
  p
|
---|
In Section
Meditations