Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

Looking at your wish list, you're not abstracting anything away at all. You're just adding a needless layer.

open a DBI connection given a hostname, database, username and password;


the user (if in an interactive context) for any of the four things above if missing;

Bad idea. Data storage and user interaction are unrelated tasks.

supply a method for preparing a query;


supply a method for executing a prepared query;


allow the user to just call DBModule::run_query("select ... from ... where ...") and expect the module to properly prepare/execute

If $dbh->prepare + $sth->execute is really a hardship,

sub do_select { my($dbh, $statement, $attr, @bind_values) = @_; my $sth = $dbh->prepare($statement, $attr) or return undef; $sth->execute(@bind_values) or return undef; return $sth; }

while helpfully handling / trapping Sybase error codes

RaiseError => 1

supply a method to reformat the result set into various hashes/arrays


supply a method to release a result set (equiv to $sth->finish()

$sth->finish, though rarely needed.

In reply to Re: lost in my first Perl module by ikegami
in thread lost in my first Perl module by chexmix

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?

What's my password?
Create A New User
Domain Nodelet?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (8)
As of 2022-10-04 16:14 GMT
Find Nodes?
    Voting Booth?
    My preferred way to holiday/vacation is:

    Results (18 votes). Check out past polls.