On 1/11/19 6:51 PM, ToddAndMargo via perl6-users wrote:
On 1/11/19 6:49 PM, Brad Gilbert wrote:
$a is short for $a{'a','b'}
This also happens in string literals
my $a = { a => 1, b => 2 };
say "$a"; # 1 2
say "$a{'a','b'}"; # 1 2
A simple way to stop this is to add a backslash
On 1/11/19 6:49 PM, Brad Gilbert wrote:
$a is short for $a{'a','b'}
This also happens in string literals
my $a = { a => 1, b => 2 };
say "$a"; # 1 2
say "$a{'a','b'}"; # 1 2
A simple way to stop this is to add a backslash
my $a = 'b'
say "$a\"; # b
You can also call
On 1/11/19 6:35 PM, Bruce Gray wrote:
On Jan 11, 2019, at 7:08 PM, ToddAndMargo via perl6-users
wrote:
Hi All,
Now what am I doing wrong? I need to convert the value in a
hash to a string:
$ p6 'my $x = "acme"; my Str $y; my %Vendors = ( acme => ContactName => "Larry" );
$y= %Vendors; s
$a is short for $a{'a','b'}
This also happens in string literals
my $a = { a => 1, b => 2 };
say "$a"; # 1 2
say "$a{'a','b'}"; # 1 2
A simple way to stop this is to add a backslash
my $a = 'b'
say "$a\"; # b
You can also call methods on variables in string literals, as lon
On 1/11/19 6:23 PM, Tom Browder wrote:
On Fri, Jan 11, 2019 at 20:15 ToddAndMargo via perl6-users
mailto:perl6-users@perl.org>> wrote:
...
> $p6 'my $x = "acme"; my %Vendors = ( acme => { ContactName => "Larry",
> AccountNo => 1234 } ); my Str $y = %Vendors{$x}.Str; say
$y;'
In my experienc
> On Jan 11, 2019, at 7:08 PM, ToddAndMargo via perl6-users
> wrote:
>
> Hi All,
>
> Now what am I doing wrong? I need to convert the value in a
> hash to a string:
>
> $ p6 'my $x = "acme"; my Str $y; my %Vendors = ( acme => ContactName =>
> "Larry" ); $y= %Vendors; say $y;'
> $ p6 'my $
On Fri, Jan 11, 2019 at 20:15 ToddAndMargo via perl6-users <
perl6-users@perl.org> wrote:
...
> $p6 'my $x = "acme"; my %Vendors = ( acme => { ContactName => "Larry",
> AccountNo => 1234 } ); my Str $y = %Vendors{$x}.Str; say $y;'
In my experience, it helps often to avoid using strict typing unles
On 1/11/19 5:59 PM, Tom Browder wrote:
On Fri, Jan 11, 2019 at 19:09 ToddAndMargo via perl6-users
mailto:perl6-users@perl.org>> wrote:
Now what am I doing wrong? I need to convert the value in a
hash to a string:
$ p6 'my $x = "acme"; my Str $y; my %Vendors = ( acme => ContactNa
On 1/11/19 5:08 PM, ToddAndMargo via perl6-users wrote:
Hi All,
Now what am I doing wrong? I need to convert the value in a
hash to a string:
$ p6 'my $x = "acme"; my Str $y; my %Vendors = ( acme => ContactName =>
"Larry" ); $y= %Vendors; say $y;'
Type check failed in assignment to $y; expec
On Fri, Jan 11, 2019 at 19:09 ToddAndMargo via perl6-users <
perl6-users@perl.org> wrote:
> Now what am I doing wrong? I need to convert the value in a
> hash to a string:
>
> $ p6 'my $x = "acme"; my Str $y; my %Vendors = ( acme => ContactName =>
> "Larry" );
Try eliminating “acme =>” for a st
Hi All,
Now what am I doing wrong? I need to convert the value in a
hash to a string:
$ p6 'my $x = "acme"; my Str $y; my %Vendors = ( acme => ContactName =>
"Larry" ); $y= %Vendors; say $y;'
Type check failed in assignment to $y; expected Str but got Any (Any)
in block at -e line 1
$ p6
11 matches
Mail list logo