in reply to Re: adding a column of integers
in thread adding a column of integers

If you're in the mood for doing sneaky tricks with -n then why not be really sneaky:

perl -lne '$;+=$_}{print$'

Smylers

Replies are listed 'Best First'.
Re^3: adding a column of integers
by Anonymous Monk on Sep 02, 2004 at 21:19 UTC

      That's overkill; miss out 3 of the characters and it still works:

      perl -lpe '$-+=$_}{$_=$-'

      Smylers