http://www.perlmonks.org?node_id=1193171


in reply to Re^2: Perl Modules
in thread Perl Modules

Here is a very simple script and module to demo the principles. First a module with 1 subroutine

package pm::mytest; sub message { return 'Hello from pm:mytest'; } 1;

and a script that uses it

#!/usr/bin/perl use strict; use warnings; use CGI; use CGI::Carp 'fatalsToBrowser'; use lib 'd:/apache24/htdocs'; use pm::mytest; my $msg = pm::mytest::message(); my $q = CGI->new; print $q->header,$q->start_html, $q->h1($msg),$q->end_html;
poj