in reply to hash key

Trying to describe code using English leaves room for misinterpretation; using code to describe code is more discrete.

To wit:

#!/usr/bin/perl use strict; use warnings; my %my_hash = (); my $key1 = "T::c"; # The key has no quotation mar +ks in it my $key2 = '"T::c"'; # This key does actually have +the quotes $my_hash{$key1} = 'Nonquoted key'; $my_hash{$key2} = 'Quoted key'; # Show the hard-coded selection from the hash my $test_value = $my_hash{"T::c"}; print "\$test_value = $test_value\n"; # Show the whole hash foreach my $my_key (sort keys %my_hash) { print "\%my_hash{$my_key} = $my_hash{$my_key}\n"; } exit;

Results:

S:\Steve\Dev\PerlMonks\P-2017-05-30@1228-Hash-Key-Quotes>hashkey1.pl $test_value = Nonquoted key %my_hash{"T::c"} = Quoted key %my_hash{T::c} = Nonquoted key