Tugger the SLUGger!SLUG Mailing List Archives

Re: [SLUG] Tuesday afternoon shell command optimisation party!


<quote who="Martin Visser">

>  perl -e 'while(<>){$a+=s/[,]//g};print "$a\n"' <input.txt
> 
> Do I win??

Oddly, perl very rarely wins these. ;-)

- Jeff

-- 
linux.conf.au 2008: Melbourne, Australia        http://lca2008.linux.org.au/
 
   "Odd is good by the way. I knew normal in high school and normal hates
                            me." - Mary Gardiner