in reply to Re: faulty expression prob
in thread faulty expression prob

You removed the check that prevented the method tag from being called on an undefined value.
$dist = $rh->tag('DISTRIBUTION');
should be
$dist = $rh && $rh->tag('DISTRIBUTION');

Also,

$pkg->{DIST} = $dist ? $dist : undef
can be written as
$pkg->{DIST} = $dist || undef

Replies are listed 'Best First'.
Re^3: faulty expression prob
by perl-diddler (Chaplain) on Apr 03, 2008 at 23:17 UTC
    Um...somewhere along the line, someone dropped a "$" before "undef"..."$undef" != undef, but $undef = 'undef''; In answer to next Q, I did want assignments -- they needed to be evaluated or done left-to-right, where the 'right' side isn't done if the left side fails... If I wanted to use "==" instead of assignment, I would have preferred '&&' over 'and'. I try to use 'and' && 'or' when I don't want them interfering with an assignment.

      where the 'right' side isn't done if the left side fails...

      That's what $rv && does.

      Update: Hum, at first, I thought you you were disagreeing with what I posted, but I think you were just confirming what I said.