Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

autrijus (1505)

autrijus
  (email not shown publicly)
http://pugs.blogs.com/

Journal of autrijus (1505)

Thursday May 26, 2005
10:45 PM

Day 115: More Pugs/Perl5 fun

[ #24898 ]
See clkao's journal. Also note that we can pass coro {...} to Perl 5 land too.

This also works:

#!/usr/bin/pugs

use v6;
use DBI--perl5;
# use perl5:DBI; # in Pugs 6.2.8+, write this instead

unlink 'test.db';

my $dbh = DBI.connect('dbi:SQLite:dbname=test.db');
$dbh.do("CREATE TABLE Test (Project, Pumpking)");

my $sth = $dbh.prepare("INSERT INTO Test VALUES (?, ?)");
$sth.execute(<Pugs Autrijus>);
$sth.execute(<Ponie Nicholas>);
$sth.execute(<Parrot Leo>);

my $res = $dbh.selectall_hashref('SELECT * FROM Test', 'Pumpking');

# Just another Pugs hacker
say "Just another $res<Autrijus><Project> hacker";

Still lots of things left to do -- I want to share runloop as much as possible, so $CALLER::x can see into Perl 5 lexicals, and maybe reify the control stack both ways via Coro.pm if it's installed. But this is already quite usable for real-world scripting... I'm so excited. :-)

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.