Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^4: Draft - Writng pluggable programs with perl.

by yosefm (Friar)
on Jun 14, 2004 at 14:52 UTC ( #366564=note: print w/ replies, xml ) Need Help??


in reply to Re^3: Draft - Writng pluggable programs with perl.
in thread Draft - Writng plugable programs with perl.

    As for context ... context objects, imho, should be used only when there is no other option. They are basically global variables, with all the pitfalls that entails without any of the benefits. Plus, there's a ton of bookkeeping involved and every single object needs to know about it, and possibly every single method. It is messy, dangerous, and ugly.

That depends on the implementation. If used correctly, a context object is just like a fancy OO way of giving arguments, one that allows you to do some more interesting stuff. Otherwise, you're definitely right.

For example, the MovableType guys created a 'stash' in their context object, that allows just anyone to put stuff in it, making it exactly the pitfall you described.

I'll say again that I only put it in the tutorial to 'float a phrase' and show what it might look like.


perl -e'$b=unpack"b*",pack"H*","59dfce2d6b1664d3b26cd9969503";\ for(;$a<length$b;$a+=9){print+pack"b8",substr$b,$a,8;}'
My public key


Comment on Re^4: Draft - Writng pluggable programs with perl.
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (13)
As of 2014-07-10 17:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (214 votes), past polls