diff options
author | Jesse Luehrs <doy@tozt.net> | 2009-09-30 12:23:05 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2009-09-30 12:23:05 -0500 |
commit | 9ad40376962f2aaf94cf25c452bb7a740ab80413 (patch) | |
tree | 3d11c1e9a5e6b37d62e8ddb97d5149bae9c2a92c /bin/sum | |
parent | eb30c112fbadaad12a94f22cf5f7d0a9a7c10e15 (diff) | |
download | conf-9ad40376962f2aaf94cf25c452bb7a740ab80413.tar.gz conf-9ad40376962f2aaf94cf25c452bb7a740ab80413.zip |
script to add a series of numbers from stdin
Diffstat (limited to 'bin/sum')
-rwxr-xr-x | bin/sum | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -0,0 +1,4 @@ +#!/usr/bin/env perl +use 5.010; +use List::Util 'sum'; +say sum map { s/^((?:\d|[-+\.])+).*/$1/; $_ } <>; |