Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Clashes of variable in a web-server while allowing multiuser???

by cool (Scribe)
on Aug 11, 2006 at 19:55 UTC ( #566931=perlquestion: print w/replies, xml ) Need Help??

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

Hi monks,
First of all, this is not exactly of a Perl question, but again it can't be ignored either. So here it goes, for my web server if I allow more than one user to access the program at any instance of time; will there be any clashes between the arrays, scalars or hashes. What I mean is, if user A and user B submit job at same time then any variable of my program, let say $x can have clashes for the two users inputs. Though I am uploading file from user and saving it by giving each file as different name. But for this volatile data that just live up during the functioning of code, what are the possibility of clashes?

One more thing, I feel this issue can be sorted out if I que up the inputs from the user. By allowing one user's input at a time while quing up the other.. How this can be done in Perl with CGI.
Any suggestion or advise, monks!! Looking forward for the help.

2006-08-11 Retitled by planetscape, as per Monastery guidelines

( keep:0 edit:10 reap:0 )

Original title: 'Clashes of varible in a web-server while allowing multiuser???'

  • Comment on Clashes of variable in a web-server while allowing multiuser???

Replies are listed 'Best First'.
Re: Clashes of variable in a web-server while allowing multiuser???
by perrin (Chancellor) on Aug 11, 2006 at 20:09 UTC
    When using CGI, all requests run in separate processes and there is no sharing of variables whatsoever. You do not need to worry about it.
Re: Clashes of variable in a web-server while allowing multiuser???
by andyford (Curate) on Aug 11, 2006 at 20:11 UTC
    You will have problems if both users try to simultaneously modify the same external file, but the two user's scripts will execute separately.
Re: Clashes of variable in a web-server while allowing multiuser???
by leocharre (Priest) on Aug 12, 2006 at 07:54 UTC

    When the server runs the script, the script is no longer the stuff you typed up, it now becomes a thing in memory space. That means, if you make infiniteloop.pl and run it, and delete the file, the thing will keep going and going.. and going... So.. You see, each "run" of the script, is actually a "copy" .. or an 'instance'.

    You may want to look at the lovely CGI::Session, sounds like you'll head there at some point.

      Thanks for inputs Leocharre! I will have a look and get back to you.
      Thanks again :)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2020-02-17 06:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What numbers are you going to focus on primarily in 2020?










    Results (70 votes). Check out past polls.

    Notices?