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

Re: autodie.pm design questions

From:
Paul Fenwick
Date:
June 4, 2008 03:59
Subject:
Re: autodie.pm design questions
Message ID:
4846758E.6060101@perltraining.com.au
G'day Roland / p5p,

Roland Giersig wrote:

> 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.

The lack of a prototype on system() means that, should we replace it, the 
exotic form (only when used in the same package) becomes a syntax error 
which is generated at compile-time.  To the very best of my knowledge, 
there's nothing I can possibly do about this without changing perl itself 
(throwing any sort of backwards portability out the window), or using 
source-filters (which I think are a very bad idea).

If I *could* intercept the exotic system, I would, and have it work as 
expected, and everyone could go and have ice-cream.  As it is, I can only 
break it.  However the break is obvious, and easily repaired by prefixing it 
with CORE:: .

I'm actually fairly convinced now that breaking exotic system() to provide a 
nice exception-throwing regular system() for those who want it is 
worthwhile.  I even expect to have a version of IPC::System::Simple up on 
the CPAN that allows this to work in the next couple of days.  Anyone who's 
been wanting Fatal to do the same thing can have their presents early. ;)

Cheerio,

	Paul

-- 
Paul Fenwick <pjf@perltraining.com.au> | http://perltraining.com.au/
Director of Training                   | Ph:  +61 3 9354 6001
Perl Training Australia                | Fax: +61 3 9354 2681



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