Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
It does not yet support scalarIO or bind by reference it is now a known issue with the Inline::Perl5 folk, to whom I was able to explain its use and that the purpose was not just for speed
- Loading branch information
H.Merijn Brand
committed
Feb 6, 2015
1 parent
63b911d
commit 720dc26
Showing
2 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/pro/bin/perl | ||
|
||
use 5.20.0; | ||
use warnings; | ||
|
||
use DBI; | ||
|
||
my $dbh = DBI->connect ("dbi:Pg:"); | ||
|
||
my $sth = $dbh->prepare ("select count (*) from url"); | ||
$sth->execute; | ||
$sth->bind_columns (\my $count); | ||
$sth->fetch; | ||
say $count; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!perl6 | ||
|
||
use v6; | ||
use Slang::Tuxic; | ||
use Inline::Perl5; | ||
|
||
my $p5 = Inline::Perl5.new; | ||
|
||
$p5.use ("DBI"); | ||
|
||
my $dbh = $p5.invoke ("DBI", "connect", "dbi:Pg:"); | ||
|
||
my $sth = $dbh.prepare ("select count (*) from url"); | ||
$sth.execute; | ||
$sth.bind_columns (\my $count); | ||
my @count = $sth.fetchrow_array; | ||
@count[0].say; |