Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re: Re^2: Falling for the same trap - since 1942

by dws (Chancellor)
on Jul 14, 2003 at 16:25 UTC ( #274033=note: print w/replies, xml ) Need Help??

in reply to Re^2: Falling for the same trap - since 1942
in thread Falling for the same trap since 1942

Well, since the guy who wrote that is in my Perlmongers group and I got the link from following a discussion on our mailing list, I feel qualified to say he is talking about any dynamic web programming.

I went back and read the rest of the stuff on his site, and you're right. He's either talking about Perl without saying so, or is talking in general. The funny thing is that the page you cited could have come right out of a J2EE discussion forum.

I disagree though, that the underlying issue is that using a session object equates to using global state, unless there's some peculiarity with the one he's using. Generally, session objects are kept in a hash keyed by session id, and themselves hold hashes (or the equivalent) for stuffing in session-specific data. Adding data to one session doesn't ipso facto make it available to others. The problem, or one of them, is that session object can become a dumping ground for cruft that isn't garbage collected until the session expires. One can look at that as clogging up the session's namespace, I suppose.

  • Comment on Re: Re^2: Falling for the same trap - since 1942

Replies are listed 'Best First'.
Re^4: Falling for the same trap - since 1942
by Aristotle (Chancellor) on Jul 15, 2003 at 08:24 UTC
    Exactly. Putting stuff in a session object makes it global across a) all your handlers b) all the code in a single handler. As he says, if you're not careful, soon, your pages depend on being called in the right order. Just like with careless use of globals, your functions depend on being called in the right order..

    Makeshifts last the longest.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://274033]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2018-06-20 15:16 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (116 votes). Check out past polls.