in reply to creating operands

As you cannot create definedor operand and don't want to wait for Perl 5.10, emulate it (differs from previos variants, as assigns $self->error to $foo, what you maybe (???) want to do):
$foo = defined($bar->id) ? $bar->id : $self->error('blah blah');

Replies are listed 'Best First'.
Re^2: creating operands
by ikegami (Patriarch) on Jul 13, 2006 at 18:11 UTC

    That's not equivalent. If you wanted to use the ternary operator,
    defined($foo = $bar->id) or $self->error('blah blah');
    would be equivalent to
    defined($foo = $bar->id) ? undef : $self->error('blah blah');

    $foo = defined($bar->id) || $self->error('blah blah');
    would be equivalent to
    $foo = defined($bar->id) ? $bar->id : $self->error('blah blah');
    but that's not relevant here.