in reply to $var{'a',1,...}

You should learn to use the Data::Dumper module to do your investigation. It is one of the most important perl modules.

use Data::Dumper; $var{ 'a', 1, 'b', 2 } = 1; # ^ this statement builds a simple hash table, %var print Dumper(\%var);

This shows that the above is really...
$VAR1 = { 'a1b2' => 1 };

Replies are listed 'Best First'.
Re: $var{'a',1,...}
by benizi (Hermit) on May 24, 2005 at 19:19 UTC

    Careful when using Data::Dumper to dump strings.

    use Data::Dumper; $h{"a", 1, "b", 2} = 1; $h{a1b2} = 2; print Dumper \%h;
    produces the counterintuitive:

    $VAR1 = { 'a1b2' => 2, 'a1b2' => 1 };

    But:

    use Data::Dumper; $h{"a", 1, "b", 2} = 1; $h{a1b2} = 2; $_ = Dumper \%h; s/(\P{IsPrint})/"\\x{".sprintf "%04x}", ord $1/ge; print
    reveals:
    $VAR1 = { 'a1b2' => 2, 'a\x{001c}1\x{001c}b\x{001c}2' => 1 };

    ("\x{001c}" eq "\034" eq chr(28) eq $; See first reply.)