in reply to creating operands

This operator is called "defined-or". In Perl, it written as //; there is also a low-priority form, err.

I believe these were introduced in core Perl as of 5.9.2. They are also in Perl 6.

So, for your example, you'd do

$foo = $bar->id err $self->error('blah blah');
We're building the house of the future together.

Replies are listed 'Best First'.
Re^2: creating operands
by diotalevi (Canon) on Jul 13, 2006 at 19:52 UTC

    H. Merjin Brand also distributes patches against the 5.8.x series for this. They can be downloaded from his CPAN directory.

    ⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊