Package.pl Problems (imported subroutines)

software development

#1

I’m a little new to PERL but have considerable programming experience in other languages. I am trying to create a file of PERL subroutines. I made sure that my subroutines work by simply pasting the subroutines into the .pl file. Once I verified they work, I moved the subroutines to a file called “packages.pl” {The original intent was to compile the subroutines into a package.pm file but I had problems so I tried something that I thought was the simple equivalent to “#include” in C}.

So my .pl files now have:

require “package.pl”;

where the subroutines where and package.pl now contains the subroutines and nothing else. My PERL syntax checker is happy. I reduced the subroutine to something very simple.

Example: package.pl has the following:

sub ShowPic
{
my @parms = @_;
print <<SHOW_PIC;

ShowPic_Test

SHOW_PIC } return 1; } #ShowPic

I’m not sure if it was necessary for the package.pl file but I did a “chmod 755 *.pl” anyway.

When executing this code I get:

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, webmaster@webpresenceplus.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

So what am I doing wrong?

Thanks,

Jack