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

Re: design questions

Paul Fenwick
June 4, 2008 03:59
Re: design questions
Message ID:
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. ;)



Paul Fenwick <> |
Director of Training                   | Ph:  +61 3 9354 6001
Perl Training Australia                | Fax: +61 3 9354 2681 Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About