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 ]

Beatnik (493)

Beatnik
  (email not shown publicly)
http://www.ldl48.org/

A 29 year old belgian who likes Mountain Dew, Girl Scout Cookies, Tim Hortons French Vanilla Flavoured Cappucinno, Belgian beer, Belgian chocolate, Belgian women, Magners Cider, chocolate chipped cookies and Perl. Likes snowboarding, snorkling, sailing and silence. Bach can really cheer him up! He still misses his dog.

Project Daddy of Spine [sf.net], a mod_perl based CMS.

In his superhero time (8.30 AM to 5.30 PM), he works on world peace.

Journal of Beatnik (493)

Sunday December 07, 2003
12:41 PM

Tricks

[ #16202 ]
2 small tweaks I applied to my code in the last months...

Module::default, to be used like $object = OtherModule->get(...) || Module::default;. Basically I want OtherModule::get to return an instance of Module (from an unidentified source). If, for some reason, it can't, I want to use the default values. The reason why I'm not stuffing default values in the constructor at this point is basically because I don't always want the default values.

Foo::tohash, where Module is a basic getter/setter class. I use it to pass around values. In the database layer I have a DBFoo, which inherits almost everything from DBModule. I only change the DB fields in DBFoo so it will use the hash for storing the record in the DB (after doing proper checking ofcourse.

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.