Slash Boxes
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 ]

jdavidb (1361)

  (email not shown publicly)

J. David Blackstone has a Bachelor of Science in Computer Science and Engineering and nine years of experience at a wireless telecommunications company, where he learned Perl and never looked back. J. David has an advantage in that he works really hard, he has a passion for writing good software, and he knows many of the world's best Perl programmers.

Journal of jdavidb (1361)

Wednesday June 21, 2006
12:34 PM

DBI and my laziness

[ #29998 ]

I often find myself memoizing a routine that takes a DBI database handle and some SQL and returns a statement handle. I know the right way to do this is to just get the statement handle once and store it somewhere. The preferred storage spot would be in an object, but I'm not coding that way. Second best would be in a variable private to the block that needs the statement handle, but I'm too lazy even for that. I don't want to worry about where it's stored, and so I let worry about it for me.

It'd be nice if DBI had a cached_prepare method to do this.

I recognize that this is not a good kind of laziness on my part. (Although I'm willing to here arguments that it is. :) )

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