develooper Front page | perl.perl5.porters | Postings from July 2008

strictly no indirect object syntax?

Thread Previous | Thread Next
From:
Nicholas Clark
Date:
July 3, 2008 03:10
Subject:
strictly no indirect object syntax?
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


Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About