Syntactic Confectionery Delight | |
PerlMonks |
Re: Subtraction by digitby eric256 (Parson) |
on Feb 11, 2008 at 17:11 UTC ( [id://667418]=note: print w/replies, xml ) | Need Help?? |
Some code would have been nice, but you can try push( @c, shift(@a) - shift(@b)) while (@a and @b); It is destructive, but @c will contain the results when it is done and it. or a non-descructive version $c[$_] = $a[$_] - $b[$_] for 0 .. ($#a < $#b ? $#a : $#b);, but I think the first is easier to read. ;) Updated thanks to some comments from ysth regarding precedence and a typo ) ___________ Eric Hodges
In Section
Seekers of Perl Wisdom
|
|