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: Beginner:
Why does this not work on UNIX - 2 liner?

 



S_Shrum
User

Jan 22, 2001, 10:19 AM

Post #1 of 4 (904 views)
Why does this not work on UNIX - 2 liner? Can't Post

#!/usr/bin/per
print "<b>|</b> <a href=\"$ENV{HTTP_REFERER}\">Back</a>";

What is the deal with this code...It works beautifully on my NT intranet?

Sean Shrum
sean@shrum.net

P.S. I know it is not the perl location as I have another script that works fine.



perlplexer
Deleted

Jan 22, 2001, 10:25 AM

Post #2 of 4 (901 views)
Re: Why does this not work on UNIX - 2 liner? [In reply to] Can't Post

#!/usr/bin/per <---- or is it just a typo? ;)

Try the following code

#!/usr/bin/perl
print <<HTML;
Content-type: text/html\n\n
<b>|</b> <a href="$ENV{HTTP_REFERER}">Back</a>
HTML


--perlplexer



S_Shrum
User

Jan 22, 2001, 10:51 AM

Post #3 of 4 (900 views)
Re: Why does this not work on UNIX - 2 liner? [In reply to] Can't Post

typo...=}

But hey, that worked! Question:

I though any line that had the # in front was a comment line...why did this effect the:

#!/usr/bin/perl (as opposed to "#!/usr/bin/per")

Thanks for the help.

Sean Shrum
sean@shrum.net

#!/usr/bin/perl
print "Content-type: text/html\n\n";
print "<b>|</b> <a href=\"$ENV{HTTP_REFERER}\">Back</a>";

However, when the call is made as a SSI, nothing is returned. I figure, even if the script works, the SSI would at least print out:

"Content type: html/text\n\n | Back"

Any ideas?



japhy
Enthusiast

Jan 22, 2001, 11:45 AM

Post #4 of 4 (897 views)
Re: Why does this not work on UNIX - 2 liner? [In reply to] Can't Post

The #! line (which should be the top line of your program) is called the "shebang" line, and tells the operating system where to find the interpreter for this script.

Jeff "japhy" Pinyan -- accomplished hacker, teacher, lecturer, and author

 
 


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

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