[Memphis.pm] perl one liner

Hal Phillips HPhillips at harrahs.com
Wed Sep 26 08:25:17 CDT 2001


Interesting, I ran this on and AIX s80 w 8gig of ram versus wc -l on a nigh
million line file, and the perl won on time....  I wouldn't have guessed it!

box:/tmp> timex perl -lpe '}$_=$.;{' hal.tmp
989702

real 6.83
user 5.42
sys  1.41

box:/tmp> timex wc -l hal.tmp
  989702 hal.tmp

real 11.45
user 9.77
sys  1.68

-Hal Phillips
Programmer, Harrahs Entertainment

> -----Original Message-----
> From:	Keith W. Sheffield [SMTP:sheff at pobox.com]
> Sent:	Tuesday, September 25, 2001 9:42 PM
> To:	memphis-pm-list at pm.org
> Subject:	[Memphis.pm] perl one liner
> 
> 
> At the last golum meeting I mentioned seeing a perl one liner that just
> counts the lines in a file.  Here it is:
> 
> perl -lpe '}$_=$.;{'   [optional list of files]
> 
> 
> 
> --------------------------------------------------------------------------
> --
> To unsubscribe, please send email to majordomo at pm.org
> with 'unsubscribe memphis-pm-list' in the body of the message.
> --------------------------------------------------------------------------
> --
> 
----------------------------------------------------------------------------
To unsubscribe, please send email to majordomo at pm.org
with 'unsubscribe memphis-pm-list' in the body of the message.
----------------------------------------------------------------------------




More information about the Memphis-pm mailing list