Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Execute a Perl script in a browser

by choroba (Cardinal)
on Apr 20, 2016 at 21:38 UTC ( [id://1161031]=note: print w/replies, xml ) Need Help??


in reply to Execute a Perl script in a browser

You can run the web server locally on your computer. For example, see HTTP::Server::Simple.

To try a more modern way, have a look at Dancer:

perl -MDancer -e 'get "/" => sub { "Hello world" }; dance' >> Dancer 1.3202 server 15071 listening on http://0.0.0.0:3000 == Entering the development dance floor ...

Then just point the browser to the indicated address.

($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,

Replies are listed 'Best First'.
Re^2: Execute a Perl script in a browser
by FreeBeerReekingMonk (Deacon) on Apr 21, 2016 at 07:40 UTC
Re^2: Execute a Perl script in a browser
by federico-perlmonks (Novice) on Apr 21, 2016 at 14:50 UTC

    I took a look at dancer and HTTP::Server::Simple. Tell me if I am wrong, but I think when I use Dancer I still have to launch the script from the command line and then use the browser to connect to the address told by Dancer, right?
    HTTP::Server::Simple may be too complex to me... but if I will not find a simpler solution, I will try it.

      Yes, you have to start the server. But you only need to start it once, you can then query it many times. You might need to restart it when the code changes, though.
      ($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,

        All right, thank you very much.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (10)
As of 2024-04-18 09:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found