in reply to testing an if statement in a string
my @field = (0,0,0,0,0,0,'PM',0,'CAVENDI'); my $cond = q(($field[6] eq 'PM' && $field[8] eq 'CAVENDI')); my $ret; eval "\$ret = $cond"; warn $@ if $@; print $ret;
In Section
Seekers of Perl Wisdom
in reply to testing an if statement in a string
my @field = (0,0,0,0,0,0,'PM',0,'CAVENDI'); my $cond = q(($field[6] eq 'PM' && $field[8] eq 'CAVENDI')); my $ret; eval "\$ret = $cond"; warn $@ if $@; print $ret;