Web Hosting Vodahost    

Home Take The Royal Tour! Order Now Features Prices
Go Back   Web Hosting > VodaHost Web Hosting Support > Scripts & Fantastico

Notices

Scripts & Fantastico Discussions, help and troubleshooting scripts included is adding popular Fantastico scripts to your website such as guest books, osCommerce shopping cart, polls, content management systems etc…

Reply
 
LinkBack Thread Tools
  #1  
Old 07-06-2008, 10:20 AM
Private First Class
 
Join Date: May 2008
Posts: 7
Exclamation Running and debugging a perl script

Hi, could someone please help me out with a perl script.

My final intent is to run an automated script that cleans up MySQL, but I am having difficulties even executing a simple script.

My idea was to make a perl script that simply writes "Hello world".

The script is at: http://www.koolinavacationvillas.com/test.pl

Permissions are set to 755 and the script is in the public_html directory.

I was expecting to see some text back when I click on the above script, but I get an error 500.

I suspect this is to do with the way that I am trying to run the script, but really am not sure. Any help would be appreciated!

Code:
!/usr/bin/perl
 
BEGIN {
    my $homedir = ( getpwuid($>) )[7];
    my @user_include;
    foreach my $path (@INC) {
        if ( -d $homedir . '/perl' . $path ) {
            push @user_include, $homedir . '/perl' . $path;
        }
    }
    unshift @INC, @user_include;
}
 
print "<HTML><BODY>Hello word</BODY></HTML>";
Regards,
Jeremy Green
http://koolinavacationvillas.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2  
Old 07-06-2008, 02:22 PM
Private First Class
 
Join Date: May 2008
Posts: 7
Smile Re: Running and debugging a perl script

I think I have answered my own question, but this may be useful for others. The first line returned must be the content type, or the web server will thrown an internal error. Adding this above the BEGIN fixes the problem:

Code:
print "Content-type: text/html\n\n";
Jeremy Green
http://koolinavacationvillas.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT +1. The time now is 02:34 PM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC7
2007 VodaHost.com - All Rights Reserved

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