Hello all. I have the following construct:

        $freqidx{$key}[$_] += $fields[$vars[$_-1]] for( 0..$#vars );

It is inside some type of loop. What I need to do is use the conditional
operator if possible to do something like this:

if( $fields[$vars[$_-1]] ne "" ) {
        $freqidx{$key}[$_] += $fields[$vars[$_-1]];
} else {
        $freqidx{$key}[$_] += 0;
}

For a final resolution along the lines of:

( $fields[$vars[$_-1]] ne "" ? $freqidx{$key}[$_] += $fields[$vars[$_-1]]; :
$freqidx{$key}[$_] += 0; ) for( 0..$#vars );

Would the above line work correctly or something else need to be done? Thank
you.

--Jess

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to