Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Greetings, rahu_6697, and welcome to Perl(monks). :-)

Your question is somewhat vague, as to exact needs. But then again, Perl is new to you. So you get a pass this time. ;-)

If I had to guess; I'd say you're looking to discover how to run/execute Perl scripts on your hosted web/internet account, and how to print (produce) Perl/CGI driven web pages. That's a pretty large topic to cover in a single reply on Perl Monks. But using your provided example in the OP; I might suggest using the feature/say . It's a bit like Heredoc ( Here Document ). Here's my version using Feature say:

#!/usr/local/bin/perl -w use strict; use feature qw(say); print "content-type:text/html; charset=utf-8\n\n"; say qq~<!DOCTYPE html> <html lang="en"><head> <title>Hello, world!</title> </head><body> <h1>Hello, world!</h1> </body></html>~;
As you can see, it's quite a bit simpler. While I'd have generally dumped all the commonly used stuff into a sub, of even made, or used an existing module that already provided that. All of that strays from your question. So I'll refrain from digression. :-)

Secondly; you'll need to know where your hosing provider puts Perl for it's users. So you can use the right "shebang, or just "bang". That refers to the first line:#!/usr/local/bin/perl . Generally speaking, and as you noted you're on a *NIX platform. Your choices are either in /usr/bin/perl , or /usr/local/bin/perl. You can best determine that by way of which , or whereis . A couple of *NIX commands that tell you -- if you haven't already guessed; where stuff is. :-). So here's an example session:

# which perl /usr/local/bin/perl
or
# whereis perl perl: /usr/local/bin/perl /usr/local/lib/perl5/5.26/perl/man/man1/perl +.1.gz /usr/src/contrib/file/magic/Magdir/perl
As you can see, the output is different; the command whereis being quite a bit more informative. :-)

Lastly. You'll need/want to know where your hosting provider allows you to execute Perl scripts. This information should have been provided in the TOS (Terms of Service) you were required to agree to, when you signed up. Or it might also be in a FAQ (Frequently Asked Questions) they have on their site.

Well, I think that probably covers it.
HTH

--Chris

Evil is good, for without it, Good would have no value
¡λɐp ʇɑəɹ⅁ ɐ əʌɐɥ puɐ ʻꜱdləɥ ꜱᴉɥʇ ədoH


In reply to Re: PERL-CGI on shared unix server by taint
in thread PERL-CGI on shared unix server by rahu_6697

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (6)
As of 2024-04-19 13:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found