mpersico has asked for the wisdom of the Perl Monks concerning the following question:
Just when I thought I had seen everything:
##eek what magic is this?my %hash; my $foo = 'hello'; my $bar = 'world'; my $baz = 'folk'; $hash{ $foo, $bar, $baz } = '##eek what magic is this?'; print $hash{"$foo\x{1c}$bar\x{1c}$baz"};
By what rule are multiple variables, separated by a comma, turned into a string with a File Separator between the pieces? I mean if I squint hard enough, that expression for the key is a list, and then the list is "stringified" to be a key, in which case I would have expected a space (\x{20}) separated expression. Perl 5.16 and Perl 5.26.1
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Hash key composition with a comma?
by LanX (Saint) on Mar 16, 2018 at 20:18 UTC | |
Re: Hash key composition with a comma?
by pryrt (Abbot) on Mar 16, 2018 at 20:16 UTC | |
Re: Hash key composition with a comma?
by pwagyi (Monk) on Mar 17, 2018 at 08:00 UTC | |
Re: Hash key composition with a comma?
by Anonymous Monk on Mar 16, 2018 at 23:27 UTC | |
Re: Hash key composition with a comma?
by Anonymous Monk on Mar 17, 2018 at 03:21 UTC | |
by Your Mother (Archbishop) on Mar 17, 2018 at 04:47 UTC | |
by Anonymous Monk on Mar 17, 2018 at 13:34 UTC | |
by LanX (Saint) on Mar 17, 2018 at 22:19 UTC | |
by Your Mother (Archbishop) on Mar 17, 2018 at 18:34 UTC | |
by LanX (Saint) on Mar 18, 2018 at 00:39 UTC | |
| |
by sauoq (Abbot) on Mar 18, 2018 at 13:25 UTC | |
| |
A reply falls below the community's threshold of quality. You may see it by logging in. |
Back to
Seekers of Perl Wisdom