#FINDS THE COMPLEX ARGUMENT #PRETTY SURE THIS WORKS TOO sub argComplex { my $value1, $real1, $complex1; $value1 = @_[0]; @construct = &constructComplex($value1); $real1= @construct[0]; $complex1 = @construct[2]; return atan2($complex1, $real1); } $real1 = 1; $z = 1 + i; #LOOK HERE #RETURNS ZERO #I DON'T KNOW WHY #BY ITSELF, argComplex($z) RETURNS 0.7854, WHICH IS RIGHT ACCORDING TO MATLAB print $real1 * argComplex($z);