I never really understood why some porters[1] had a problem with it. I think there was a lack of consensus about what to call it (definedor
, dor
, err
), but in retrospect, I'd be tempted to believe the true reason is a lack of comfort with use feature
. Keep in mind that use feature
and //
were added to Perl in the same version.
Or maybe not. You can find the conversation on the p5 porters mailing list.
By the way, the intent of the following is quite obvious:
my $x = <>
// return;
It's a bad practice to hide a return
at the end of a line anyway. Alternatives are:
( my $x = <> )
// return;
defined( my $x = <> )
or return;
my $x = <>;
$x // return;
my $x = <>;
return if !defined($x);
Those of those are compatible with commonly used 5.8.
- Those who work on Perl itself.