Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^2: OOP: How to construct multiple instances of a class at once

by Tanktalus (Canon)
on Nov 15, 2012 at 03:03 UTC ( [id://1003923]=note: print w/replies, xml ) Need Help??


in reply to Re: OOP: How to construct multiple instances of a class at once
in thread OOP: How to construct multiple instances of a class at once

Scrubbing for Bobby Tables issues? No, the SQL needs to be written for those issues.

my $sql = 'SELECT user_id, user_name FROM users WHERE user_id IN (' . +join(',', ('?') x @ids) . ')'; #... $sth->execute(@ids);
Especially since perl makes this so trivially easy, as compared to, say, C.

Replies are listed 'Best First'.
Re^3: OOP: How to construct multiple instances of a class at once
by runrig (Abbot) on Nov 15, 2012 at 16:18 UTC
    If the ids were strings, I might use map $dbh->quote($_), @ids, but since they're probably integers, validating that they're /^\d+$/ is probably good enough. Either is also easy.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (3)
As of 2024-04-26 01:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found