[Melbourne-pm] When your variables can't keep their types..

Toby Corkindale toby.corkindale at strategicdata.com.au
Thu Jun 2 21:49:19 PDT 2016

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?!";

More information about the Melbourne-pm mailing list