Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > How does a script language work in a server

Reply
Thread Tools

How does a script language work in a server

 
 
John
Guest
Posts: n/a
 
      05-25-2012
When someone uses s browser and goes to a www.somesite.com/someperl.pl how does
it work at the server end? Let's say I'd like to create a "perl-clone" or
something like perl or php where would I get more info?
 
Reply With Quote
 
 
 
 
jaialai.technology@gmail.com
Guest
Posts: n/a
 
      05-25-2012
On 5/25/12 2:34 PM, John wrote:
> When someone uses s browser and goes to a www.somesite.com/someperl.pl how does
> it work at the server end?


The web server will either return the raw contents of that page or, if
configured to do so, execute the file and instead return the output.
Again, this is a server specific configuration.

>Let's say I'd like to create a "perl-clone" or
> something like perl or php where would I get more info?


You'd like to design a new language? Jeez, kind of a big thing to do.
I'd start with the basics. Here is a free online book that I think is
really good and is very approachable if you already know Perl.
http://billhails.net/Book/
After you make it through that take what you learned and check out
some real life examples. There is no shortage of code for you to
go through in this area. Look at what Perl6, Jython, or PHP are
doing, for example.


 
Reply With Quote
 
 
 
 
ccc31807
Guest
Posts: n/a
 
      05-25-2012
On May 25, 2:34*pm, John <(E-Mail Removed)> wrote:
> When someone uses s browser and goes to awww.somesite.com/someperl.plhow does
> it work at the server end? Let's say I'd like to create a "perl-clone" or
> something like perl or php where would I get more info?


There are a number of ways this /could/ work, but the simplest case
perhaps is CGI. It works like this:

1. The client user accesses http://example.com/script.cgi
2. The client browser constructs an HTTP header and perhaps body
3. The package is sent over the wire to some web server
4. The web server receives the HTTP request and parses it
5. The web server decides that 'cgi' represents a call to a script,
and hands it off to a script, invoking the Perl executable, and sends
the appropriate parameters
6. The Perl executable executes the script, accepting the parameters
as input and returning the appropriate results as output. This usually
consists of HTML, but could consists of other things and usually
involves some other kinds of machinations behind the scenes, like
running some SQL against a database and munging the SQL results
7. The web server receives the return value from the script and sends
it back down the wire to the client browser
8. The client browser renders the HTML, or does some else (like show a
Flash movie or play a wav file)

CC.
 
Reply With Quote
 
Jürgen Exner
Guest
Posts: n/a
 
      05-25-2012
John <(E-Mail Removed)> wrote:
>When someone uses s browser and goes to a www.somesite.com/someperl.pl how does
>it work at the server end?


That depends totally upon how the server is configured. The server may
respond by sending the content of this file (provided this URL actually
does refer to a file), it may execute this file as a program and return
any output this program generates (those two are common scenarios), it
may query a database and return all results that are found using the
query someperl.pl (not so common), or it may do any of a gazillion
different things. It all depends on how the server is configured.

>Let's say I'd like to create a "perl-clone" or
>something like perl or php where would I get more info?


At relevant graduate classes about "Design of Programming Languages" and
"Compiler Construction" at your favourite university.

jue
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
How to execute a script from another script and other script does notdo busy wait. Rajat Python 3 01-08-2010 02:05 PM
Python as active script <script language=python> misterdi Python 0 07-28-2009 04:30 PM
JSP problem: <script language="JavaScript"> '<%=expression%>' </script> Edward Java 1 04-03-2006 06:15 PM
<script language="vb" runat=server> versus <% %> jason@cyberpine.com ASP .Net 1 10-31-2003 01:33 AM



Advertisments