Re: DBIish: Why can't I interpolate variable holding database name?

2016-05-01 Thread Moritz Lenz
On 01.05.2016 15:36, James E Keenan wrote: > > Thanks; that worked: > > # > cat dbiish_connect_dynamic_3.pl6 > #!/usr/bin/env perl6 > use DBIish; > > my $db = 'hierarchy'; > my $dbh = DBIish.connect("Pg", :database($db)); Another nice little language feature is that you can reuse the name o

Re: DBIish: Why can't I interpolate variable holding database name?

2016-05-01 Thread James E Keenan
On 05/01/2016 09:12 AM, Mathieu Gagnonn wrote: Hello James, You can try :database($db) Look at this http://design.perl6.org/S02.html#Adverbial_Pair_forms I've found it very useful! James E Keenan writes: Yesterday I made my first attempt at using any library in a Perl6 program -- specifical

Re: DBIish: Why can't I interpolate variable holding database name?

2016-05-01 Thread Brock Wilcox
Right - use parenthesis in colon-pair parameters to get the variable inside. You could use :database<<$db>> to make it like a double-quoted string. Or my favorite is to use regular => as in database => $db --Brock On May 1, 2016 09:13, "Mathieu Gagnonn" wrote: Hello James, You can try :databas

Re: DBIish: Why can't I interpolate variable holding database name?

2016-05-01 Thread Mathieu Gagnonn
Hello James, You can try :database($db) Look at this http://design.perl6.org/S02.html#Adverbial_Pair_forms I've found it very useful! James E Keenan writes: > Yesterday I made my first attempt at using any library in a Perl6 > program -- specifically, DBIish. > > The following succeeded in est

DBIish: Why can't I interpolate variable holding database name?

2016-05-01 Thread James E Keenan
Yesterday I made my first attempt at using any library in a Perl6 program -- specifically, DBIish. The following succeeded in establishing a connection to a Postgresql database named 'hierarchy' on the same disk as Perl6: # $ cat dbiish_connect.pl6 #!/usr/bin/env perl6 use DBIish; my $db