On 3/26/07, Mike Lesser <[EMAIL PROTECTED]> wrote:
Hi all. First time using subroutines in external files. I've had some sporadic success with some simple libs (not modules), but can't seem to get consistent results.
What do you mean by "sporadic success"? Does something work only on some invocations of your program? Once you can get it to work, doesn't it keep working?
use FindBin qw($Bin); use lib "$Bin/Libs";
'use lib' doesn't load your library files; it just tells Perl where to find them. You still need to load them (either with require or use). You could put code like this after those two lines; the BEGIN block ensures that the external subroutines are compiled before the following code begins compilation. BEGIN { require "first.pl"; require "another.pl"; require "one_more.pl"; }
yeah, they're executable, and yeah, I've tried several approaches.
Modules and libraries don't normally need to be marked as executable. Hope this helps! --Tom Phoenix Stonehenge Perl Training -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/