http://qs1969.pair.com?node_id=796847


in reply to Yet Another Perl Object Model (Inside Out Objects)

I was watching a tech talk by Doug Crockford called JavaScript: The Good Parts and JavaScript has inside-out objects, who knew :)
var singleton = (function () { var privateVariable; function privateFunction(x) { ...privateVariable... } return { firstMethod: function (a, b) { ...privateVariable... }, secondMethod: function (c) { ...privateFunction()... } }; }());