P is for Practical | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
I dunno, tye ... I sincerely respect your greater knowledge on this particular subject, but I certainly believe that UNIVERSAL::require has helped me out of quite-a-few tight spots. It’s a very small bit of source-code, actually, but it sure did grease a lot of hinges. Nevertheless, looking-over the OP’s original posting (and never-mind UNIVERSAL at this point ...), I do feel that most of these bullet-points should properly be dismissed as hypothetical ... or as “downright suspicious.” “Suspicious,” in fact, to the degree that we should not consent to write code that is willing to accomodate them. “Suspicious S.O.B. that I am,” I think that it is perfectly reasonable to presume that any module that we might actually wish to consent to require into our systems should be entirely free of compile-errors and should return true. If it does not, then why-the-heck should we be willing to presume that “the source-file that we are referencing” is, in fact, the legitimate piece of source-code that we (innocently? naïvely?) expected to find? It could just as easily be a rogue – a malicious imposter – that some Evil Entity™ didn’t quite get quite-right the first time. The “stock” implementation of require has a few pragmatic rough-edges that can be fairly glossed-over (e.g. by UNIVERSAL ...), but we should never allow our “suspension of disbelief” to go too-far. If any situation that we encounter crosses the boundary of healthy suspicion, we should not allow it to proceed. In reply to Re: The 'eval "require $module; 1"' idiom
by sundialsvc4
|
|