Skip to content

Instantly share code, notes, and snippets.

@2shortplanks
Created July 5, 2013 20:58
Show Gist options
  • Select an option

  • Save 2shortplanks/5937205 to your computer and use it in GitHub Desktop.

Select an option

Save 2shortplanks/5937205 to your computer and use it in GitHub Desktop.
#!/usr/bin/env perl
use 5.012;
use warnings;
use JSON::XS qw(decode_json);
use Devel::Peek;
foreach (1..2) {
my $string = '{"a":false,"b":false}';
my $decode = decode_json($string);
Dump $decode->{a};
Dump $decode->{b};
}
mark@travis-5:/www [ticket1295] $ perl /tmp/foo
SV = IV(0x7ff374012aa0) at 0x7ff374012ab0
REFCNT = 1
FLAGS = (ROK)
RV = 0x7ff37402d3e0
SV = PVMG(0x7ff37400f6f0) at 0x7ff37402d3e0
REFCNT = 3
FLAGS = (PADMY,OBJECT,IOK,READONLY,OVERLOAD,pIOK)
IV = 0
NV = 0
PV = 0
STASH = 0x7ff374026050 "JSON::XS::Boolean"
SV = IV(0x7ff374012ab8) at 0x7ff374012ac8
REFCNT = 1
FLAGS = (ROK)
RV = 0x7ff37402d3e0
SV = PVMG(0x7ff37400f6f0) at 0x7ff37402d3e0
REFCNT = 3
FLAGS = (PADMY,OBJECT,IOK,READONLY,OVERLOAD,pIOK)
IV = 0
NV = 0
PV = 0
STASH = 0x7ff374026050 "JSON::XS::Boolean"
SV = IV(0x7ff374012ab8) at 0x7ff374012ac8
REFCNT = 1
FLAGS = (ROK)
RV = 0x7ff37402d3e0
SV = PVMG(0x7ff37400f6f0) at 0x7ff37402d3e0
REFCNT = 3
FLAGS = (PADMY,OBJECT,IOK,READONLY,OVERLOAD,pIOK)
IV = 0
NV = 0
PV = 0
STASH = 0x7ff374026050 "JSON::XS::Boolean"
SV = IV(0x7ff374012aa0) at 0x7ff374012ab0
REFCNT = 1
FLAGS = (ROK)
RV = 0x7ff37402d3e0
SV = PVMG(0x7ff37400f6f0) at 0x7ff37402d3e0
REFCNT = 3
FLAGS = (PADMY,OBJECT,IOK,READONLY,OVERLOAD,pIOK)
IV = 0
NV = 0
PV = 0
STASH = 0x7ff374026050 "JSON::XS::Boolean"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment