Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   Perl (http://www.programmingforums.org/forum21.html)
-   -   Running a Mac-Written Script on a Linux Machine (http://www.programmingforums.org/showthread.php?t=13998)

Sane Sep 20th, 2007 2:44 PM

Running a Mac-Written Script on a Linux Machine
 
Hey guys, it's been a while. I'm only here for a quick question, because I need this answered asap for the work I'm doing (at Nortel btw).

I've written the simplest piece of code ever, on a Mac in MacPerl.

:

#!/usr/bin/perl
print "Hello World!";


I can run this fine on the Mac's test console, receiving the appropriate output.

However, when I upload it to the Linux server via Fetch, I get a 500 Internal Server Error. Despite the fact that there are hundreds of other working Perl scripts in that exact same directory (with the same file permissions).

My first thought is that the ASCII is being encoded differently, such as with newlines and quotations. Can anyone confirm this, and suggest a fix?

P.S. Congrats PFO. You are the first website (besides Google) that displays correctly on the old Internet Explorer so far! You're a life saver! :D

fahlyn Nov 1st, 2007 9:30 PM

Re: Running a Mac-Written Script on a Linux Machine
 
The problem is that you're not printing a header....try adding this

:

print "Content-type:text/html\n\n";

Sane Nov 1st, 2007 9:46 PM

Re: Running a Mac-Written Script on a Linux Machine
 
I figured out it wasn't transferring the newlines properly. Thanks for the help anyways.


All times are GMT -5. The time now is 3:03 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC