in reply to Re: Safe to use ternary operator like this?
in thread Safe to use ternary operator like this?

Not quite the same thing depending on the sub return though:
use strict; my $temp; $temp = defined ($temp = func()) ? $temp : 'undefined'; print "func:$temp\n"; $temp = func() || 'undefined'; print "func:$temp\n"; sub func { return ''; }
produces:
func: func:undefined