Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^2: Can DBI modify queries on the fly?

by kyle (Abbot)
on Feb 18, 2009 at 02:07 UTC ( #744614=note: print w/replies, xml ) Need Help??


in reply to Re: Can DBI modify queries on the fly?
in thread Can DBI modify queries on the fly?

Wow, I wish that were more documented. I haven't tried it yet, but I suspect that will work great. My main concern comes from this line of the tests:

is ref $attr, 'HASH', 'param modified by callback - not recommended!';

Modifying params by callback is exactly what I want to do. So why is it not recommended? I'm guessing this means that the solution I eventually come up with will stop working at some point in the future, but I guess I'll curse that bridge when I come to it.

Replies are listed 'Best First'.
Re^3: Can DBI modify queries on the fly?
by ikegami (Pope) on Feb 18, 2009 at 02:19 UTC
    That refers to modifying @_ only, not modifying copies of what's in @_ or SQL placeholders

      That's kind of the whole point, though, isn't it? The callback can't return any values. The only way to make any changes to what's going on is to modify the parameters directly. Or am I missing something?

      As such, you have to worry about changing the application's data under its nose. You also have to watch out for the case where you're passed a read-only value.

        What does modifying variables in the caller got to do with overriding a method? You haven't specified why you want to override the method, but I'm guessing "the point" is to change the values passed to your override then call the original method. How does modifying a variable that probably won't ever be used again help you?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://744614]
help
Chatterbox?
[Discipulus]: you are rigth, gory details but i remember from dunnowhere that concetrate caffein is more effective than brown water almost coffe..
[LanX]: prepared both kinds a 100 times and thinks the amount of grind code is about the same
Discipulus less effective i mean
[LanX]: (french press vs espresso cooker )
[LanX]: s/code/coffee/
Discipulus progammer is an organism that transforms caffeine into software..
[LanX]: hmm interesting link

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (8)
As of 2017-01-16 11:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (149 votes). Check out past polls.