CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
using Perl module in CGI script

 



tine
Novice

Feb 13, 2004, 2:54 AM

Post #1 of 3 (612 views)
using Perl module in CGI script Can't Post

Hi,

In my cgi script i use two perl modules, i include them first:


Quote


use lib "../include/";
use Personeel;
use Loginnaam;

When i use this module later on in the program:


Quote
$TotNames = Personeel::pers_mail($mailadres); $loginnaam = Loginnaam::Login(lc($voorletters),lc($tussen),lc($achternaam));



it gives the results i want, a unique e-mail addres and a uniqe loginname are created(the modules make the e-mail address and a loginname and check if they exist in an LDAP server). But i keep getting an error:


Quote


The XML page cannot be displayed

Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.


A declaration was not closed. Error processing resource 'file:///C:/Documents and Settings/Mikdt/Local Settings/Temp/Temporary Internet Files/Content.IE5/8DIRC1M7/index[3]'. Line 1, Position 1 <



I do not get this error when i skip the use of both the modules. So i am quite sure it is these that are causing the problem.. but why?? If i leave out the use of these modules, it displays the next page without any problems.

Any ideas?

Tine


davorg
Thaumaturge / Moderator

Feb 13, 2004, 3:48 AM

Post #2 of 3 (610 views)
Re: [tine] using Perl module in CGI script [In reply to] Can't Post

Sounds like your browser is getting a little confused about the content type of the data returned. Is it supposed to be returning XML? What content type header are you displaying?

Have you tried running the program from the command line and just seeing what output you get?

Oh, and please learn how to export functions from your modules. It will make your code look much cleaner.

--
Dave Cross, Perl Hacker, Trainer and Writer
http://www.dave.org.uk/
Get more help at Perl Monks


tine
Novice

Feb 13, 2004, 4:16 AM

Post #3 of 3 (608 views)
Re: [davorg] using Perl module in CGI script [In reply to] Can't Post

The strange thing is that the source code is right! If i just save it and open it again in a browser, it shows the correct page... there are no missing declarations.. As i said, i can leave out using the modules, and the page is shown correctly.

i will learn to export functions from modules, thanks for the tip!

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives