Hi: I'm stuck! I've tried a thousand things from forum suggestions...I need to parse the unit from a value and test that it exists based on known units (its not for school, its Jan 1..)
this ALWAYS returns DNE !!
even when i add debug prints the result is:
array el is : mV , $1 is : mV
UNIT DNE : mV
I have tried grep, exists, any please help!
Code:
#/usr/bin/perl
my @unit = qw(mV V mA uA A K m uV nA nV pA pV);
while( defined($line = <LOGFILE>) )
{
if( $line =~ /d+(\s*\w+)/ )
{
# now test if match exists!
foreach( @validUnits )
{
if( $_ eq $1)
{
print "FOUND unit : $1\n\n";
}
else
{
print "UNIT DNE : $1\n\n";
}
}
}
this ALWAYS returns DNE !!
even when i add debug prints the result is:
array el is : mV , $1 is : mV
UNIT DNE : mV
I have tried grep, exists, any please help!
Comment