I'm probably missing something but it seems to me you are making life hard by calculating that running total or whatever it is?
Why not just store the original first value and the deltas?
#! perl -w use strict; sub decode { my $val; return map { $val += $_ } @_; } my @input = qw( 1000 1 -21 44 -1 ); my @output = decode @input; print "@output", $/; __END__ C:\test>190239 1000 1001 980 1024 1023
In reply to Re: Perl Drag Racing - sum/delta list
by BrowserUk
in thread Perl Drag Racing - sum/delta list
by John M. Dlugosz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |