Charles K. Clarkson wrote:

   IMO, the easiest thing to do in the log run is to change
"stuff.pl" into a module called (perhaps) "stuff.pm". The you
can "use" it. You might end up with something like this:

package stuff;

require Exporter;
@ISA = qw(Exporter);

@EXPORT_OK = qw( foo );

sub foo {
   return 'foo';
}

1;

   It would be called like this:

#!/usr/bin/perl

use strict;
use warnings;

use lib '.';
use stuff 'foo';

print foo();

__END__


Read the docs for Exporter on how to export functions and variables easily. Read perlmod for more info on writing modules.

HTH,

Charles K. Clarkson



Thanks. Much appreciated :)

--
Daniel Kasak
IT Developer
NUS Consulting Group
Level 5, 77 Pacific Highway
North Sydney, NSW, Australia 2060
T: (+61) 2 9922-7676 / F: (+61) 2 9922 7989
email: [EMAIL PROTECTED]
website: http://www.nusconsulting.com.au

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>

Reply via email to