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

Development with Autoloader

by cbraga (Pilgrim)
on Oct 05, 2003 at 18:24 UTC ( [id://296745]=note: print w/replies, xml ) Need Help??


in reply to Filepointer of source file inside source filter

You see, you don't need to split your modules when developing with Autoloader. Your program will work just fine. You only have to split the modules when creating a production version.

Also, your own solution suffers from some of the ills you place on Autoloader, namely, the need for preprocessing the file and somewhere to store its metadata.

You make a point for Autoloader's uncleanliness with having the code put after the __END__ label but your module is also unclean sice you'll need it to be the first source filter to be loaded.

Replies are listed 'Best First'.
Re: Development with Autoload
by liz (Monsignor) on Oct 05, 2003 at 18:53 UTC
    Hmmm... I may be missing something. But if I have a module Foo:
    package Foo; use AutoLoader qw(AUTOLOAD); 1; __END__ sub a {print "a\n" }
    and a program:
    use Foo; a();
    I get the following error:
    Can't locate auto/Foo/autosplit.ix in @INC (@INC contains: /usr/local/lib/perl5/5.8.1/darwin-thread-multi /usr/local/lib/perl5/5.8.1 /usr/local/lib/perl5/site_perl/5.8.1/darwin-thread-multi /usr/local/lib/perl5/site_perl/5.8.1 /usr/local/lib/perl5/site_perl .) at /usr/local/lib/perl5/5.8.1/AutoLoader.pm line 160. at Foo.pm line 3 Undefined subroutine &main::a called at x line 2.
    which indicates to me you must install your module before you can test it. Maybe you don't get an error if you've already installed a module that way, but then you're not running the development version, but the installed version!

    Or are we talking about different things, as you are talking about "Autoload" and I'm talking about AutoLoader?

    Liz

      I guess you're right, I should've typed "Autoloader" and typed "Autoload". I also didn't express myself correctly on the first paragraph. I guess I rushed out and forgot to mention I meant to comment out Autoloader and don't use it when developing the module. Thanks for the -1 though.

Log In?
Username:
Password:

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

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

    No recent polls found