go ahead... be a heretic | |
PerlMonks |
RE: RE: RE (tilly) 1: Fly Subroutines on the Flyby chromatic (Archbishop) |
on Sep 19, 2000 at 07:09 UTC ( [id://33052]=note: print w/replies, xml ) | Need Help?? |
I could imagine a database access object that was actually a blessed coderef to a SQL query.
You might write the method generally enough that it could return the first appropriate match for the query, or all matches. With a closure (which will be blessed), you could bind the query to operate on a single table (or a specific query string or whatever)... and you could choose to return a single value from the query or a listref or a hashref. That's a contrived example, yes, but I could imagine using it somewhere.
In Section
Seekers of Perl Wisdom
|
|