[kw-pm] Last night's meeting

Raymond broadswd at gmail.com
Fri Jun 19 05:50:58 PDT 2009


(Replying to all this time, oops)

>From the above:

 $ perl -ne'rand++$n<1?$s=$_:1;END{print$s}' <alpha.html

No need to increment a counter like $n, just use $. which gives the
line number 1 indexed.

 $ perl -ne'rand$.<1?$a=$_:1;END{print$a}' <alpha.html

Also replaced $s with $a so it runs safe under 'warnings'. ;) Two more
characters saved.


More information about the kw-pm mailing list