Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^4: System and CGI - File Created but not the Content

by monkfan (Curate)
on Sep 18, 2007 at 12:37 UTC ( #639626=note: print w/ replies, xml ) Need Help??


in reply to Re^3: System and CGI - File Created but not the Content
in thread System and CGI - File Created but not the Content

... write a daemon that runs a normal user, validates it input and executes the program. The CGI script and the daemon can communicate via TCP or named pipes.
How do you do that? Using Perl script? Do you have any example of it?
Sorry I'm quite new to this, so obvious thing may not be obvious to me.

Regards,
Edward


Comment on Re^4: System and CGI - File Created but not the Content
Re^5: System and CGI - File Created but not the Content
by moritz (Cardinal) on Sep 18, 2007 at 12:53 UTC
    Here is an example how you write a perl script that moves itself into the background (might not work on windows...):

    !/usr/bin/perl use strict; use warnings; my $ret_val = fork(); if (! defined $ret_val){ die "Can't fork(): $!"; } elsif ($ret_val == 0){ # do your daemon tasks here sleep 5; print "Exiting\n"; } else { exit 0; }

    As for the server you should check the Net::Server module.

      Here is an example how you write a perl script that moves itself into the background (might not work on windows...):

      That's OK. The original script almost certainly would.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2014-09-15 03:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (145 votes), past polls