Printing some basic PERL text.

They have: 62 posts

Joined: May 2000

This is how it's done, I'm sure.

#!/usr/bin/perl

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

print "heh";

Yet, that simple script, I still get a 500!!!! Is there something here I just don't see or is something wrong with the server's PERL interpretator?

They have: 568 posts

Joined: Nov 1999

1. Change the top line to our path to perl if that isn't it
2. Upload in ASCII
3. Chmod 755

Ken Elliott's picture

They have: 358 posts

Joined: Jun 1999

Well I have run into your problem as well. I found that sometimes it requires the full html headers. So try printing

BLEH

these tags as well and it might rectify your situation.

VulKen
BOLD

Pimpin like a pimp with an electrofied pimpin machine!

They have: 568 posts

Joined: Nov 1999

actually those HTML headers wont affect the output.

They have: 45 posts

Joined: Aug 2000

You just wont see anything.

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

The script is fine, just check the stuff Orpheous said.

They have: 45 posts

Joined: Aug 2000

If you dont tell the browser it wont know what to do.

They have: 568 posts

Joined: Nov 1999

actually thats not true.

in most cases the browser will print the basic headers if it doesn't detect them.

Ken Elliott's picture

They have: 358 posts

Joined: Jun 1999

I was just saying what I found. I made a simple script, and it was giving me premature end of script headers...so I went through everything, and once I put in the proper html headers, the script executed fine.

The script executed fine in command line, but the browser didn't like it. So I was just givin' my 2 cents.

GL
VulKen

Pimpin like a pimp with an electrofied pimpin machine!

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

You could always use:

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

Then your browser should just print whatever you tell it, thinking it's just a ASCII file.

Mark Hensler
If there is no answer on Google, then there is no question.

Ken Elliott's picture

They have: 358 posts

Joined: Jun 1999

Just curious, would the browser print it out like a text file?? Or would it compile the page? This could prove quite useful for me.

Thanx.
VulKen
I'm Higher In The Food Chain, GET IN MY BELLY!

Pimpin like a pimp with an electrofied pimpin machine!

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

with:
print "Content-type: text/plain\n\n";

it *should* print it like a .txt file

They have: 62 posts

Joined: May 2000

I think it was some weird server problem. It worked the next day, without any changes.

And if I had uploaded in binary, I would have got an error in the ol' Telnet checker. Oh well, just more adventures in PERL!

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.