hmm. i got scared by the perlmod doc. they show a big template to use. and it doesn't have to run through any other program to massage it? and it will be found if the file is in the same directory as the file that calls it? ok. i'll try it. is this an obvious feature that i was unable to grasp from anything i saw online?
On Friday, February 22, 2002, at 08:28 PM, Tanton Gibbs wrote: > I don't think creating a module is a big deal...how about > > file Utility.pm: > > package Utility; > > sub trim { > my $val = shift; > $val =~ s/^\s+//; > $val =~ s/\s+$//; > return $val; > } > > In file user.pl > > use Utility; > > while( <> ) { > print Utility::trim( $_ ); > } > > There is a module containing a utility function that is then used by a > user > script...seems pretty straight forward to me. Naturally, there can be > more > to it than that, but there doesn't have to be or even need to be in a case > like the above. > > Tanton > ----- Original Message ----- > From: "bob ackerman" <[EMAIL PROTECTED]> > To: "Aaron Shurts" <[EMAIL PROTECTED]> > Cc: <[EMAIL PROTECTED]> > Sent: Friday, February 22, 2002 11:22 PM > Subject: Re: sharing subroutines > > >> fine, except that creating a module seems like a big deal. you are >> minimizing the effort when you show me one subroutine as a module. there >> is a heap of bookkeeping to attend to. the docs indicate that modules are >> meant to be created and put in public use - i.e., generally of use. >> i just want a create an application where a few different scripts can all >> call on some common subroutines. >> am i making to big a fuss? is creating a module a trivial task? >> >> On Friday, February 22, 2002, at 05:12 PM, Aaron Shurts wrote: >> >>> I am not exactly sure what you are asking, but if I give out the answer >>> yes, in a module. Does that make sense? Kind of like this... >>> >>> # >>> # contents of HelloName.pm >>> # >>> sub hello_name { >>> ($name) = @_; >>> >>> printf("Hello %s\n", $name); >>> } >>> >>> Then in your script you would have something like this... >>> >>> use lib '/src/common'; >>> use HelloName.pm; >>> use strict; >>> >>> my $name = 'Joe'; >>> &hello_name($name); >>> >>> >>> >>> -----Original Message----- >>> From: bob ackerman [mailto:[EMAIL PROTECTED]] >>> Sent: Friday, February 22, 2002 5:03 PM >>> To: [EMAIL PROTECTED] >>> Subject: sharing subroutines >>> >>> >>> is there a way to share uncompiled perl scripts? that is, to include the >>> >>> subroutines of one script file into another script file. >>> failing that, can i easily compile a perl script and use it in a script? >>> why am i having trouble figuring this out? >>> >>> >>> -- >>> To unsubscribe, e-mail: [EMAIL PROTECTED] >>> For additional commands, e-mail: [EMAIL PROTECTED] >>> >> >> >> -- >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]