Custom PM Modules Won't Work

Ask a Question related to PERL Modules, Design and Development.

  1. #1

    Default Custom PM Modules Won't Work

    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


    Rob Guest

  2. Similar Questions and Discussions

    1. Flex 3 GA Designer doesn't work with my modules
      This is absolutely critical to our application. In Flex 3 Beta I had no issues doing this, in Flex 3 GA it does not work and I'm wondering if any...
    2. Yahoo! Merchant Custom modules?
      I am having the same problem and was wondering how/if you ever resovled. Thanks:disgust;
    3. Custom Font does not work in Acrobat 6
      We have a Custom designed True Type Font for the company, this Font is used for all MS Word documents. This was fine with Acrobat 5, but we have just...
    4. Custom print settings won't work
      I am printing on 13x16 inch paper. In page setup photoshop ignores the custom settings when I specify my Epson 1280 printer. It will print 11x17 or...
    5. Custom HTTP Modules and Web Services
      I created a Web Service and a custom HTTP Module. I've put the HTTP Module dll in the Web Service's bin folder. I've put in the Web Service's...
  3. #2

    Default Re: Custom PM Modules Won't Work


    "Rob" <support@16pentlandclose.com> wrote in message
    news:OLR5g.1170$LU3.898@newsfe2-gui.ntli.net...
    > 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


    Sisyphus Guest

  4. #3

    Default Re: Custom PM Modules Won't Work

    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

    "Sisyphus" <sisyphus1@nomail.afraid.org> wrote in message
    news:4458089e$0$14494$afc38c87@news.optusnet.com.a u...
    >
    > "Rob" <support@16pentlandclose.com> wrote in message
    > news:OLR5g.1170$LU3.898@newsfe2-gui.ntli.net...
    >> 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
    >
    >

    Rob Guest

  5. #4

    Default Re: Custom PM Modules Won't Work


    Rob spits TOFU in our faces:

    [please don't]
    > [...] is Perl not looking in the same directory as the script for .pm files?
    Perl does not do this by default. If you are sure that you want it to,
    see the solution given in the FAQ. But it's probably better to stop
    wanting to.

    Brian McCauley Guest

  6. #5

    Default Re: Custom PM Modules Won't Work

    Thanks

    I've got it now
    FAQs are wonderful things!

    I had to add this to the top of the main page and now everything is sorted:

    use FindBin;
    use lib "$FindBin::Bin";

    Thanks
    Rob

    "Brian McCauley" <nobull67@gmail.com> wrote in message
    news:1146654831.454140.194800@v46g2000cwv.googlegr oups.com...
    >
    > Rob spits TOFU in our faces:
    >
    > [please don't]
    >
    >> [...] is Perl not looking in the same directory as the script for .pm
    >> files?
    >
    > Perl does not do this by default. If you are sure that you want it to,
    > see the solution given in the FAQ. But it's probably better to stop
    > wanting to.
    >

    Rob Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139