|
Posted by Rob on May 3, 2006, 2:11 am
Please log in for more thread options
Thanks
This works in a command prompt but won't work in a web script in IIS with
the CGI module also loaded
It says
CGI Error
The specified CGI application misbehaved by not returning a complete set of
HTTP headers.
Is it a permisions problem on the directory?
Or is Perl not looking in the same directory as the script for .pm files?
Thanks
Rob
>
>> Hello
>>
>> I have written a website using Perl which runs in IIS and I now want to
>> divide the functionality into modules but as soon as I try I get the
>> error
>> "The CGI Application Missbehaved"
>> Can someone give me a simple example Perl script that uses a module so I
> can
>> test to see if this is a server issue and can anyone recommend a way to
> fix
>> this?
>>
>> I have tried both Use and Require with the same results
>>
>> Thanks
>> Rob
>
> The module (Foo.pm):
> ---------------------------------------
> package Foo;
>
> #require Exporter;
> #@ISA = qw(Exporter);
> #@EXPORT = qw(greeting);
>
> sub greeting {
> print "Hello from foo\n";
> }
>
> 1;
> ---------------------------------------
>
> The script that uses Foo.pm:
> ---------------------------------------
> use warnings;
> use Foo;
> Foo::greeting();
> ---------------------------------------
>
> If, in Foo.pm, you include the code that is currently commented out, then
> the script could be changed to:
> ---------------------------------------
> use warnings;
> use Foo;
> greeting();
> ---------------------------------------
>
> See 'perldoc Exporter' for more info and other (better) options regarding
> export of functions from modules.
>
> Cheers,
> Rob
>
>
|