$x = "3 _ 4"; #in polar form.. 3 is mag and 4 is angle sub constructComplex{ my($value1, $real, $complex, $magnitude, $angle, @construct, @constructPolar, $isinPolarForm, $isinRectForm); $value1 = $_[0]; if($isinPolarForm) { #uses $value1 to pick out the magnitude and angle $magnitude = blah; $angle = blah; ###point of interest### @constructPolar = &constructComplex(&PolarToRect($value1)); $real = $constructPolar[0]; $complex = $constructPolar[2]; ###point of interest### } if($isinRectForm) { $real = blah; $complex = blah; #haven't implemented getting polar values from rect form because getting the rect values from polar doesn't work yet } $construct[0] = $real; $construct[1] = $complex; $construct[2] = $magnitude; $construct[3] = $angle; } sub PolarToRect { my($magnitude, $angle, $real, $complex); #does it return $magnitude . " _ " $angle; }