in reply to RFC: Perl Second-Best Practices
Oh, wow, where to start? There are a lot of nasty things I do in Perl that are actually necessary. Sometimes, they're necessary simply because the code is (originally) intended to be a quick one-off for debugging or proof-of-concept purposes, so spending 3 hours doing it "right" loses out to spending 10 minutes to get it done. And sometimes, they're necessary because there simply isn't a nicer way of doing it.
Here's a sample "second-best" pattern that I've used recently, that causes co-workers and bosses to cringe, despite being reasonably sane and acceptable. I've seen it pop up all over, most recently in merlyn's SysAdmin article:
The "no strict 'refs'" and symbol-table mucking is certainly justified, because there's really no better way to do it, but it still feels "second-best" to me.... { no strict 'refs'; *{"${class}::get_${name}"} = sub { ... }; } ...
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: RFC: Perl Second-Best Practices
by chromatic (Archbishop) on Dec 24, 2005 at 20:14 UTC | |
by Aristotle (Chancellor) on Dec 26, 2005 at 12:26 UTC | |
Re^2: RFC: Perl Second-Best Practices
by sfink (Deacon) on Dec 24, 2005 at 20:01 UTC | |
by tye (Sage) on Dec 24, 2005 at 20:59 UTC |
In Section
Meditations