-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
52 lines (34 loc) · 1.41 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
DBIx::Wrapper::VerySimple - Simplify use of DBI
===============================================
DBIx::Wrapper::VerySimple is a simple module that provides a high-level
interface to the Perl DBI module. The provided methods are for fetching
a single record (returns a hashref), many records (returns
an arrayref of hashrefs), and for executing a non-select statement
(returns a result code).
The intention here is that your application will have much cleaner code,
so instead of writing:
$sql = 'SELECT name,address FROM $table WHERE zipcode=?';
$sth = $dbh->prepare($sql);
$rv = $sth->execute($zipcode);
@found_rows;
while ( my $hash_ref = $sth->fetchrow_hashref ) {
push( @found_rows, $hash_ref );
}
You would write:
$sql = 'SELECT name,address FROM $table WHERE zipcode=?';
$found_rows = $wrapper->fetch_all($sql,$zipcode); # An arrayref of hashrefs
INSTALLATION
To install this module type the following:
perl Makefile.PL
make
make test
make install
DEPENDENCIES
This module requires these other modules and libraries:
DBI (prefer version 1.34 or later)
COPYRIGHT AND LICENCE
Copyright (c)2001-2006 by Matisse Enzer <matisse@cpan.org>
This package is free software and is provided "as is"
without express or implied warranty. It may be used,
redistributed and/or modified under the terms of the Perl
Artistic License (see http://www.perl.com/perl/misc/Artistic.html)