2

Possible Duplicate:
In Perl, what is the difference between a .pm (Perl module) and .pl (Perl script) file?

I'm trying to set up a Perl class on my host's server (iPage). But their config only recognizes Perl files with the .cgi or the .pl file tags. Is it possible to set up a Perl class without using the .pm tag?

Community
  • 1
  • 1
SonOfSeuss
  • 400
  • 5
  • 18

1 Answers1

7

You can't use the use Class::Name; syntax; you'll have to do require 'path/to/filename.pl'; instead. Other than that, it doesn't matter; the class name is equal to the name in the package statement, not the filename.

But what do you mean "their config only recognizes..."? If you have any way to get a file named .pm onto the server, you don't need their config to "recognize" it - it just needs to be where your Perl code (presumably in .cgi or .pl files) can find it.

Mark Reed
  • 91,912
  • 16
  • 138
  • 175