in reply to Help with JSON Module
Please consider taking things step by step so that you build up to the solution incrementally rather than trying to take one giant leap at the start.
use feature ":5.14"; use warnings FATAL => qw(all); use strict; use Data::Dump qw(dump pp); use JSON::PP; my $j = JSON::PP->new; my $d = $j->decode(<<'END'); { "StatusCode": 0, "StatusInfo": "Command Processed OK", "BranchNumber": "5528", "CustomerId": "20846164", "CustomerName": "Mr Stubbs", "SessionKey": "5VApkMMTjO8LtFCy9VjcSrcZKxoewwHGj6XoUUGaH2fBWf73cU", "InAmendOrderMode": "N", "BasketID": "98911496", "ChosenDeliverySlotInfo": "No delivery slot is reserved.", "CustomerForename": "James" } END pp($d)
Produces:
{ BasketID => 98911496, BranchNumber => 5528, ChosenDeliverySlotInfo => "No delivery slot is reserved.", CustomerForename => "James", CustomerId => 20846164, CustomerName => "Mr Stubbs", InAmendOrderMode => "N", SessionKey => "5VApkMMTjO8LtFCy9VjcSrcZKxoewwHGj6XoUUGaH +2fBWf73cU", StatusCode => 0, StatusInfo => "Command Processed OK", }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Help with JSON Module
by foggy3657 (Novice) on Sep 07, 2012 at 16:04 UTC | |
by foggy3657 (Novice) on Sep 07, 2012 at 16:25 UTC |