Hello Ron. Just a couple of minor comments on your example code...
On Sun, Jun 18, 2006 at 10:31:01AM +1000, Ron Savage wrote:
>
> $sth_1 = $dbh_1 -> prepare('insert into t(i) values (?)');
>
> $sth_1 -> execute($_) for (1 .. 5);
> $sth_1 -> finish();
FYI the call to finish() isn't needed here (or in most of the other
places you'll see it used).
> $sth_1 = $dbh_1 -> prepare('select * from t');
> $sth_1 -> execute();
> my($data);
> while ($data = $sth_1 ->fetch() )
> {
> print "$$data[0]. \n";
> }
Using fetchrow_arrayref() is preferable to it's old alias fetch().
The fetch method is retained as a shorthand that's more appropriate
when bind_columns() is being used.
Tim.
p.s. Your style of adding spaces around the method call arrows is
rather unusual - very few people do that.