How to create a persistant shell command session in Perl / CGI for a web app?

332 views Asked by At

I'm using a front end terminal simulator ( http://terminal.jcubic.pl/ ). I'm running Perl on the backend where I pipe the commands to and from. It's easy to execute one command, get the return code and display it for the user. However, when the next command is submitted you kinna start over. So, doing ".." an then "ls" will still give you a list of the current directory because ".." was in a different / previous session.

So, how can I create a persistent session in Perl that will be able to get the commands back and forth between the web client and the backend?

1

There are 1 answers

0
daxim On

Use a session module. WWW::Session is suitable because it is not tied to a particular framework.