Created
July 1, 2013 05:43
-
-
Save tony-o/5898608 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env perl6 | |
use DBIish; | |
use Digest::SHA; | |
use JSON::Tiny; | |
sub buf_to_hex { | |
$^buf.list.fmt('%02x', ''); | |
} | |
try { | |
print "Content-Type: text/plain\n\n"; | |
my $dbh = DBIish.connect('mysql', | |
:user(''), | |
:password(''), | |
:host('localhost'), | |
:port(3306), | |
:database(''), | |
RaiseError => True, | |
PrintError => True, | |
AutoCommit => True); | |
my $put_user = $dbh.prepare('INSERT INTO user (email, password) VALUES (?, ?)'); | |
say $put_user.errstr; # displays: Any | |
$put_user.execute( 'some1' , 'password' ); | |
CATCH { | |
say $!; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment