kiat has asked for the wisdom of the Perl Monks concerning the following question:
My questions are:#### Begin main script power.cgi #!/usr/local/bin/perl use strict; use CGI qw(:standard); #use lib '/httpd/cgi-bin/module'; use lib '.'; #use Test; #use Test qw(&power); use Test qw($hello_away &power); my $hello_here = 'hello world from here'; # Call power in Test.pm my $value = power(4); print header, start_html('Using Module'), "<p>$hello_here</p>", "<p>$hello_away</p>", "$value", end_html, ; #### End of main script #### Begin module Test.pm package Test; use strict; use base 'Exporter'; our @EXPORT = qw($hello_away); our @EXPORT_OK = qw(&power); our $hello_away = 'hello world from away'; sub power { my $var = shift; $var *= $var; return $var; } 1; #### End module
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Use module questions..
by Beatnik (Parson) on Apr 20, 2003 at 06:12 UTC | |
|
Re: Use module questions..
by pfaut (Priest) on Apr 20, 2003 at 03:35 UTC | |
by kiat (Vicar) on Apr 20, 2003 at 03:52 UTC | |
by benn (Vicar) on Apr 20, 2003 at 11:02 UTC | |
by pfaut (Priest) on Apr 20, 2003 at 15:11 UTC |