Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

RE: RE: RE (tilly) 1: Fly Subroutines on the Fly

by chromatic (Archbishop)
on Sep 19, 2000 at 07:09 UTC ( [id://33052]=note: print w/replies, xml ) Need Help??


in reply to RE: RE (tilly) 1: Fly Subroutines on the Fly
in thread Fly Subroutines on the Fly

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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://33052]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (7)
As of 2024-03-28 21:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found