Hughes, Trystan wrote:

> Hi all,
>  
> I have a file that simply contains a common set of functions, and wish to 
> include this file across many scripts. Now, I use the following statements to 
> do this...
>  
> eval "require 'F:\\SVN\\Scripts\\function_list.pl'";
> print "Unable to include script: function_list.pl: $@" if $@;
>  
> ... now with this 'function_list.pl' file I have function called 
> 'create_email'. I call this function from with the script that has the above 
> 'require' code in it and it works fine (in that it creates and sends an 
> email) but the 'print' command runs and the statement 'Unable to include 
> script: function_list.pl, did not return a value at (eval 1).' which is the 
> second line of my require call above.
>  
> Why is it getting to this message when the function_list.pl file seems to be 
> included fine, and the function within this file is executed fine?

You need to terminate your module with a true stmt - usually that means
adding a line at the end :

1;

You could also fix the front up a bit with something like:

use strict;
package main;

use Exporter();
our @ISA = qw(Exporter);
our @EXPORT = qw(sub0 sub1);            # you can put the most frequent subs 
here
our @EXPORT_OK = qw(sub2 sub3);         # the rest here where you explicitly 
have to include them
our %EXPORT_TAGS = (all => [EMAIL PROTECTED], @EXPORT_OK]);     # you can group 
subs here

our $VERSION = 0.01;



-- 
  ,-/-  __      _  _         $Bill Luebkert    Mailto:[EMAIL PROTECTED]
 (_/   /  )    // //       DBE Collectibles    Mailto:[EMAIL PROTECTED]
  / ) /--<  o // //      Castle of Medieval Myth & Magic http://www.todbe.com/
-/-' /___/_<_</_</_    http://dbecoll.tripod.com/ (My Perl/Lakers stuff)
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to