On 4/21/05, Dave Mitchell <[EMAIL PROTECTED]> wrote:
> On Wed, Apr 20, 2005 at 09:05:59PM -0500, David Nicol wrote:
> > doesn't myprint have to be defined, or at least have a prototype
> > registered for it, before reaching that point, to prevent it
> > from getting parsed as
> >      LOG->myprint(@_)
> >  , that is,
> >      &LOG::myprint(LOG => @_);
> 
> okay, here's a better example:
> 
>    my $has_foo;
>    BEGIN {
>        eval 'require Foo';
>        $has_foo = ! $@;
>    }
>    ...
>    if ($has_foo) {
>        my $foo = new Foo;
>        ...
>    }
>    else {
>        system("foo ....");
>    }
> 
> Should 'new Foo' give a compile-time warning in the case where Foo.pm
> isn't installed on the system ???

Assuming that the compiler can differentiate direct from indirect
method calls it would seem quite reasonable to warn when the indirect
form is not resolvable at compile time. If they dont want the warning
the direct form would tell the compiler "no this isn't a stupid
mistake". So FWIW i would say doing this would be great.

cheers,
yves


-- 
perl -Mre=debug -e "/just|another|perl|hacker/"

Reply via email to