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

Re: autodie.pm design questions

From:
Roland Giersig
Date:
June 4, 2008 05:41
Subject:
Re: autodie.pm design questions
Message ID:
48465732.8040207@giersig.org
Paul Fenwick wrote:
> A plain 'use autodie' on the other hand, is much more interesting.  I 
> was originally thinking it should mean:
> 
>     use autodie qw(:all);
> 
> enabling autodie for everything that the pragma knows how to change.  
> After the roles discussion with Larry and chromatic, I'm more inclined 
> for it to mean:
> 
>     use autodie qw(:default);
> 
> The default role will initially include most or all of the core 
> functions, but leaves open the possibility of user-defined subroutines 
> wishing to declare themselves to have the default role (although doing 
> so should be done with care).

How about this: plain "use autodie" fatalizes *all* functions and gives 
a warning when the user uses the exotic (or should I say esoteric) 
system() call style. To turn off the warning the user has two 
possibilities: explicitely state "use autodie qw(system)" or turn off 
autodie for the exotic system() call by prefixing it with "no autodie 
qw(system)".

Come to think of, when would that warning be emitted? When the first 
plain "use autodie" is encountered? Does the local "no autodie 
qw(system)" stand a chance to suppress that warning?

Sounds like an interesting challenge... ("interesting" as in "may you 
live in interesting times").

Toodle-oo!

Roland



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About