Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Re: When -w and use strict aren't enough...

by ysth (Canon)
on Nov 04, 2003 at 15:04 UTC ( [id://304439]=note: print w/replies, xml ) Need Help??


in reply to Re: When -w and use strict aren't enough...
in thread When -w and use strict aren't enough...

You can say that it has been the price, but I see a good niche for adding the ability to turn on stronger checking in this area.

Even with subs dynamically generated at runtime or handled via AUTOLOAD, offhand I can think of no case where there couldn't be at least a declaration at hand at compile time. It is Unfortunate that sub declarations aren't common enough in CPAN modules to allow this to be a default check.

  • Comment on Re: Re: When -w and use strict aren't enough...

Replies are listed 'Best First'.
Re^3: When -w and use strict aren't enough...
by adrianh (Chancellor) on Nov 04, 2003 at 15:26 UTC

    Of course it is technically possible to see if an appropriate entry exists in the symbol table at runtime. However, forcing everybody to add declarations for any runtime-generated subroutines strikes me as both un-perlish and extremely unlikely to happen.

      However, forcing everybody to add declarations for any runtime-generated subroutines strikes me as both un-perlish and extremely unlikely to happen.

      There's no reason it couldn't be a pragma. Why stop with use strict; use warnings; use diagnostics;  use Taint; when you can add use predeclaredsubs; use predefinedsubs; and maybe no earlyreturns; no typeglobs; and possibly use bondage; use discipline; use pain; use Inline::Pascal;


      $;=sub{$/};@;=map{my($a,$b)=($_,$;);$;=sub{$a.$b->()}} split//,".rekcah lreP rehtona tsuJ";$\=$ ;->();print$/

        I'm not saying that it cannot be done, just that it might be of limited utility since it would depend on code being written (or re-written) in a way that support the pragma.

        The pain of writing code to support the pragma may well be more than the pain saved by the compile time checking.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://304439]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (3)
As of 2024-04-19 22:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found