Whalen has asked for the wisdom of the Perl Monks concerning the following question:

I want to (Don't ask why it's long and boring) keep all the sub's of my Perl Module in seperate files, one file for each sub. I know that this is done with AutoLoader using AutoSplit. I want to know if anyone has used AutoLoader without AutoSplit. Maintaing the .al files on their own and also I assume the index file. Can it be done? What issues do you think I might encounter. Thanks for any help.

-Whalen

Replies are listed 'Best First'.
Re: Useing AutoLoader Without AutoSplit?
by dws (Chancellor) on Mar 26, 2002 at 20:57 UTC
    I want to know if anyone has used AutoLoader without AutoSplit.

    Would something like the following (untested idea) work for you?

    sub AUTOLOAD { my $func = $AUTOLOAD; die "Can't locate $func" if ! -f "$func.pl"; eval "require $func.pl"; die $@ if $@; goto &$func; }
    Update: typo correction
      That looks like the idea. I think it will work. I just want to make sure they are required into the right namespace. I have a large application with about 60 subrutines split between 5 custom perl mods. We have 10 differnt people working on them at any one time and back migrating is becoming a problem. This should help keep things moving. I'll give it a shot. Thanks.