in reply to Applying Sign Bit

Since perl doesn't implement copysign or signbit and won't let you divide by zero, the best bet is to just check for the minus:
$sign = $B[0] =~ /^\s*-/ ? -1 : 1; @result = map {$_*$sign} @B[1..$#B];