This morning I committed this bit of code:
confess "Invalid server tier '$tier'" unless defiend $file;
It's valid under use strict, and we know that our test coverage isn't
perfect...
My colleague asked "what is this "defiend" function? Is it new in Perl6?"
I suggested "maybe it removes Damians"
(http://www.perlmonks.org/index.pl?node_id=107600)
Of course, it's valid because it's indirect object syntax:
$ perl -MO=Deparse
use strict;
use Carp;
my ($tier, $file);
confess "Invalid server tier '$tier'" unless defiend $file;
__END__
use Carp;
use strict 'refs';
my($tier, $file);
confess("Invalid server tier '${tier}'") unless $file->defiend;
__DATA__
- syntax OK
Would it be viable to add a feature to the parser to outlaw invalid object
syntax? I'm not convinced that it should go on use strict as a new stricture.
Nicholas Clark
Thread Previous
|
Thread Next