On Fri, Aug 30, 2002 at 04:01:11PM +0200, Elizabeth Mattijsen wrote:
> Is there an easy way to check methods, whose loading is deferred with 
> AutoLoader, with the can_ok() check?

Nope.  You have to create stubs.  The AutoLoader module should do this
automatically for you assuming you've gone through the full build process
and AutoSplit has had a chance to do it's job.

$ Makefile.PL
Writing Makefile for AutoExample

$ make
cp lib/AutoExample.pm blib/lib/AutoExample.pm
AutoSplitting blib/lib/AutoExample.pm (blib/lib/auto/AutoExample)

$ cat blib/lib/auto/AutoExample/autosplit.ix 
# Index created by AutoSplit for blib/lib/AutoExample.pm
#    (file acts as timestamp)
package AutoExample;
sub foo  ;
1;

$ perl -Mblib -wle 'use AutoExample;  print "Yes" if AutoExample->can("foo")'
Using /home/schwern/tmp/AutoExample/blib
Yes

$ perl -Ilib  -wle 'use AutoExample;  print "Yes" if AutoExample->can("foo")'
Can't locate auto/AutoExample/autosplit.ix in @INC (@INC contains: lib 
/usr/local/lib/perl/5.6.1 /usr/local/share/perl/5.6.1 /usr/lib/perl5 /usr/share/perl5 
/usr/lib/perl/5.6.1 /usr/share/perl/5.6.1 /usr/local/lib/site_perl .) at 
/usr/share/perl/5.6.1/AutoLoader.pm line 147.
 at lib/AutoExample.pm line 5


-- 

Michael G. Schwern   <[EMAIL PROTECTED]>    http://www.pobox.com/~schwern/
Perl Quality Assurance      <[EMAIL PROTECTED]>         Kwalitee Is Job One
It's Mainline Heroin time!

Reply via email to