in reply to How can one find out the pairwise difference and product between elements in a perl array without using a perl module?

For starters, here is a destructive solution for the differences:

use strict; use warnings; my @array=qw/a b c d/; while( my $first = shift @array ) { print "$first-$_\n" for @array; }
  • Comment on Re: How can one find out the pairwise difference and product between elements in a perl array without using a perl module?
  • Download Code