sub p{
@m=1;for$p(@_){my@t;for$i(0..@m){my$j;$t[$i+$j++]+=$_*$m[$i]for@$p}@m=@t}[@m]
}
####
sub p{
@m=1;for$p(@_){my@t;for$i(0..$#m){my$j;$t[$i+$j++]+=$_*$m[$i]for@$p}@m=@t}[@m]
}
##
##
sub p{
@m=1; # Start the product at 1.
for$p(@_){ # Loop over the polynomials.
my@t; # Create a private temp array.
for$i(0..@m){ # Loop over the indexes of @m.
my$j; # Create the *other* index var.
$t[$i+$j++]+= # Manually increment $j while..
# Adding to the index of @t..
$_*$m[$i] # 2 terms multiplied together..
for@$p # for all the terms in the..
} # other polynomial.
@m=@t # Make the temp array our new
} # product.
[@m] # Return our answer in the
} # desired form.
##
##
sub p{
@m=1;for$p(@_){my@t;for$i(0..@m){$j=$i;$t[$j++]+=$_*$m[$i]for@$p}@m=@t}[@m]
}
##
##
sub p{
@m=1;for$p(@_){$i=my@t;for$,(@m){$j=$i++;$t[$j++]+=$_*$,for@$p}@m=@t}[@m]
}