in reply to Re: String to Integer, for json file
in thread String to Integer, for json file

perlnumber
use JSON qw/ to_json from_json /;
use Devel::Peek qw/ Dump /;
my $q = 3;
print "$q\n";
Dump( $q );
print to_json( { a => 3, qw/ b 3 q/, $q } );
__END__
3
SV = PVIV(0x9a3778) at 0x99b524
  REFCNT = 1
  FLAGS = (PADMY,IOK,POK,pIOK,pPOK)
  IV = 3
  PV = 0xad23bc "3"\0
  CUR = 1
  LEN = 12
{"a":3,"q":"3","b":"3"}
"a" gets 3 the number, b gets 3 the string , q becomes the 3 string
  • Comment on Re^2: String to Integer, for json file (perlnumber)