Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

chaoticset (2105)

chaoticset
  (email not shown publicly)
http://chaoticset.perlmonk.org/
AOL IM: chaoticset23 (Add Buddy, Send Message)
Yahoo! ID: illuminatus_foil (Add User, Send Message)

JAPH. (That's right -- I'm not Really Inexperienced any more.)

I'm not just here, I'm here [perlmonks.org], and here [javajunkies.org] too, I ramble randomly in my philosophical blog [blogspot.com] and my other blog [blogspot.com]. Soon I'll come in a convenient six-pack.

Journal of chaoticset (2105)

Monday July 14, 2003
10:32 AM

Eh?

[ #13436 ]
I'm doing something that's probably stupid (yes, again).

I was really tired last night and it occurred to me that it could be handy to be able to smush objects together and call one object like it was two different objects.

"Objects? You can play with them however you like," I hear you saying. True. However, if you're going to the trouble of smushing objects together, and usually you're getting your object from a module (a la CGI, HTML::Template, etc.), then wouldn't it just be easier to have some sort of thing that smushes them together for you?

And, following a dastardly and insane sort of reasoning, I've cobbled together the rough notion of the Smush module.

The idea is that, instead of use HTML::Template; and use CGI qw( params ); you would put in use Smush qw( HTML::Template CGI->params ); and it would let you call a Smush object that was an HTML::Template object but also had a params sub that acted exactly like the CGI params sub. The truly bored could have use Smush qw( HTML::Template CGI ); and would get a Smush object that acted like both.

I haven't the faintest clue if this sounds vaguely useful or not (it does to me, but I just learned about closures last week, too). I just want to see if it's possible, and I'm pretty sure it is.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.