in reply to Re: Safe to use ternary operator like this?
in thread Safe to use ternary operator like this?
produces:use strict; my $temp; $temp = defined ($temp = func()) ? $temp : 'undefined'; print "func:$temp\n"; $temp = func() || 'undefined'; print "func:$temp\n"; sub func { return ''; }
func: func:undefined
|
|---|