cdavis1986
10-10-2008, 03:03 PM
Hello! I'm trying to write a very small and basic perl module and I cannot get it to work and cannot figure out why. It's a problem with exporting functions from the module, and it refuses to work. When I run the perl script it just stops compiling right when it hits that function. Any help or ideas would be greatly appreciated!!!
Code is as follows:
MODULE(on server):
package SayHello;
use strict;
require Exporter;
our @ISA = qw(Exporter);
our @EXPORT_OK = ("hello_message");
our $VERSION=0.10;
my $hello_string="Hello World!";
sub hello_message {
return $hello_string;
}
1;
***************************************
Script (Client-Side):
#!c:/perl/bin -w
use strict;
use DynaxMod::SayHello;
use DynaxMod::SayHello ("hello_message");
print'
<html>
<head>
<title>diofj</TITLE>
</head>
<body>
';
print hello_message();
print'
</body>
</html>
';
Code is as follows:
MODULE(on server):
package SayHello;
use strict;
require Exporter;
our @ISA = qw(Exporter);
our @EXPORT_OK = ("hello_message");
our $VERSION=0.10;
my $hello_string="Hello World!";
sub hello_message {
return $hello_string;
}
1;
***************************************
Script (Client-Side):
#!c:/perl/bin -w
use strict;
use DynaxMod::SayHello;
use DynaxMod::SayHello ("hello_message");
print'
<html>
<head>
<title>diofj</TITLE>
</head>
<body>
';
print hello_message();
print'
</body>
</html>
';