Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: mod_perl vs. mod_php in multi-user environments

by fruiture (Curate)
on May 14, 2003 at 11:51 UTC ( [id://258042]=note: print w/replies, xml ) Need Help??


in reply to mod_perl vs. mod_php in multi-user environments

In mod_php an actually executed script is one limited scope within the "big program" that runs all the time, just like a mod_perl handler, but from within that scope you don't have acces to any data "above in the big program"", with mod_perl you have that access and can manipulate that "big program" and that enables you to a) do many much cooler things with mod_perl and b) do many nasty things and break more. Imagine a wrapper under mod_perl that executes a handler and causes _any_ variable in that handler to be declared via my() by default, even those who already exist as globals.

# in PHP this code: $foo = 'abc'; # creats such a private variable # in Perl $foo = 'abc'; # would change the package global $foo # or yield an error under strict

Then the handler code would be limited to it very self, comparable to a PHP script. It could still store persistent information through limited interfaces (like the mysql_ functions of PHP). In mod_php that "big program" is not a PHP script itself and there are no "superglobal" PHP variables, in mod_perl there is a "big program" that has a globel scope.

Such a wrapper would mean to emulate Perl with some changes in the guts (concering limitation of access to global variables, sounds strange, is strange).

--
http://fruiture.de

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (5)
As of 2024-03-29 13:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found