Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

How to run perlscript

by lisa2003 (Initiate)
on Jun 27, 2002 at 15:37 UTC ( [id://177731]=perlquestion: print w/replies, xml ) Need Help??

lisa2003 has asked for the wisdom of the Perl Monks concerning the following question:

Hai How to run the pearlscript in the browser.Because I have created some simple pearl print statements but I am not able to the output.Help me

Replies are listed 'Best First'.
Re: How to run perlscript
by little (Curate) on Jun 27, 2002 at 15:47 UTC
    Read the very good docs that ship along with Active Perl :-)
    look for it under:
    C:/Perl/eg/IEExamples/index.htm
    Just adjust the path to perl to find the docs, but you should have an entry in :
    Start->Programs->ActiveState AtivePerl 5.6->Dokumentation
    Scroll down the left frame a bit and look for "Windows Specific" and therein for "PerlScript"

    Have a nice day
    All decision is left to your taste

    Update

    # sample right out of the above named documentation <HTML> <HEAD> <TITLE>PerlScript Hello World!</TITLE> </HEAD> <BODY BGCOLOR="#FFFFFF"> <h2>PerlScript Hello world!</h2> <SCRIPT LANGUAGE="PerlScript"> $window->document->write('Hello world!'); </SCRIPT> </BODY> </HTML>
Re: How to run perlscript
by DamnDirtyApe (Curate) on Jun 27, 2002 at 15:49 UTC

    Perl runs server-side, not client-side. Therefore, you cannot "run" your Perl scripts in a web browser -- they are run on a web server, and the output is viewed with a web browser. If this is indeed what you mean, then:

    1. Make sure your script is executable. In UNIX/Linux, this means the execute bit must be set in the permissions for the user running the web server. Something like 755 is often appropriate. Sorry, not sure what the permissions would look like on Windows.
    2. Make sure the HTML header is being printed. If you're not using CGI (which you should be, eventually), you need a script that looks something like:
      #! /usr/bin/perl print "Content-type: text/html\n\n" ; print "<H1>Hello, World!</H1>" ;
    3. Make sure your web browser is configured to run CGI scripts. You'll have to RTFM on that one. ;-)

    Addendum: lisa2003, posting multiple copies of the same question is frowned upon, and duplicate or near-duplicate posts will be deleted. Please be patient and wait for the advice of your fellow monks.


    _______________
    D a m n D i r t y A p e
    Home Node | Email
      Sorry, but PerlScript runs alike JavaScript or VBScript on the client, hence the client needs tp have ActiveState's ActivePerl installed.
      Have a nice day
      All decision is left to your taste

        I'm sure the original poster will make use of whichever advice best applies to them. I'm not convinced that `PerlScript' is precisely what they mean, both because english is likely not the poster's first language, and because the two references to `pearl' indicate to me that the poster is obviously very, very green with Perl.


        _______________
        D a m n D i r t y A p e
        Home Node | Email
Re: How to run perlscript
by mikeirw (Pilgrim) on Jun 27, 2002 at 15:42 UTC
    Can you provide more details? Is the script that you're trying to run located on a server somewhere? Is the script executable? What kind of output are you seeing?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://177731]
Approved by little
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (7)
As of 2024-03-28 12:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found