A few modules that are likely to do the job well:
Other than that, some perlish syntax correction (NO logic correction) to your code:
while ( defined (my $scalar=<$TEST>) ) # This will accommodate the cas
+e when $seclar is Zero
{
chomp($scalar);
my ( $a, $b ) =firstidx { $_ == $scalar } @arrayPFA; # $a and $b ar
+e NOT good names - they have special meanings in perl
if(!defined $a)
{
$data=$arrayPFA[$b];
}
elsif(if any { ! defined($scalar) } @arrayT;) # No idea what is inte
+nded here...
{
$data=1.0;
}
else
{
$data=0.0;
};
};
"You're only given one little spark of madness. You mustn't lose it." - Robin Williams