Guess the output... #!/usr/bin/env perl use 5.12.0; use warnings; use JSON::XS qw(encode_json); my $port = 1234; my $j1 = encode_json({ port => $port }); my $foo = "$port"; my $j2 = encode_json({ port => $port }); say $j1; say $j2; if ($j1 ne $j2) { die "WTF Perl?!"; }