On Sun, Apr 15, 2001 at 04:46:21PM +0200, Andreas J. Koenig wrote:
> Why are you considering dynamic method calls an ill? I'm using them
> frequently.
I anticipated this. From the docs...
Perl has alot of wierd features. We love Perl for it, but
it makes predictable refactorings really difficult. This
module attempts to find (hopefully rare) uses of such
features.
We're not passing judgement on them, just noting that they
can make program behavior hard to predict.
I'm just looking for things which make refactorings a pain in the ass.
One of the basic refactoring questions is "where is this method
called?" Dynamic methods make this difficult to answer (can't get
away with a simple grep). This doesn't mean don't use them, it just
means you have to be aware of them when you're changing code around.
> > This is just a proof of concept, but it proves a few things...
>
> Very impressive and very encouraging. Thank you!
>
> So now please let me ask *everything* I always wanted to know and
> didn't dare to ask: Can we scan perl code with a guarantee that no
> BEGIN block will ever be executed?
I spent a night hacking up a B module and suddenly I know the secrets
of the universe? (The answer, at least according to what I can see,
is no). <Obvious Baiting>I'll bet even Abigail couldn't figure that
one out!</Obvious Baiting>
This is an interesting bit of hackery, though...
$ perl -cwe 'sub __ANON__::BEGIN { print 23 } BEGIN { print 42 }'
-e syntax OK
2342
Don't know where that gets you, though.
--
Michael G. Schwern <[EMAIL PROTECTED]> http://www.pobox.com/~schwern/
Perl6 Quality Assurance <[EMAIL PROTECTED]> Kwalitee Is Job One
Any sufficiently encapsulated hack is no longer a hack.