I have an object that I am receiving from LWP::UserAgent::Post
that looks like the below, there is more but this is the important part. Am I
correct in saying this is an array of hashes in a hash? I want to get some of
the values of the 0 element of 'items'. I tried
$$hash_ref{'items'}[0]{'content'} to get 'Practice pilates' but I got an error.
Experimental keys on scalar is now forbidden at todoist.pl line 79.
Am I on the right track? I am just learning about dereferencing now as I go
through the intermediate perl book. I tried adding curling braces in different
places but so far nothing works.
Thanks for any help
Derrick Cope
$VAR1 = \{
'labels' => [],
'items' => [
{
'is_archived' => 0,
'indent' => 1,
'checked' => 0,
'project_id' => 182640305,
'date_added' => 'Sat 08 Oct 2016 04:53:27 +0000',
'is_deleted' => 0,
'content' => 'Practice pilates',
'sync_id' => undef,
'item_order' => 1,
'parent_id' => undef,
'collapsed' => 0,
'date_string' => 'every day',
'all_day' => bless( do{\(my $o = 1)},
'JSON::PP::Boolean' ),
'in_history' => 0,
'priority' => 1,
'responsible_uid' => undef,
'due_date_utc' => 'Sat 05 Nov 2016 15:59:59 +0000',
'id' => 59893732,
'user_id' => 9494206,
'date_lang' => 'en',
'day_order' => 0,
'has_more_notes' => bless( do{\(my $o = 0)},
'JSON::PP::Boolean' ),
'assigned_by_uid' => 9494206,
'labels' => []
},
{
'date_string' => 'Nov 4',
'collapsed' => 0,
'parent_id' => undef,
'all_day' => ${$VAR1}->{'items'}->[0]->{'all_day'},
'responsible_uid' => undef,
'in_history' => 0,
'priority' => 4,
'due_date_utc' => 'Fri 04 Nov 2016 15:59:59 +0000',
'user_id' => 9494206,
'id' => 62037130,
'date_lang' => 'en',
'day_order' => 1,
'has_more_notes' =>
${$VAR1}->{'items'}->[0]->{'has_more_notes'},
'assigned_by_uid' => undef,
'labels' => [],
'is_archived' => 0,
'indent' => 1,
'checked' => 0,
'project_id' => 183055698,
'date_added' => 'Fri 21 Oct 2016 02:10:29 +0000',
'sync_id' => undef,
'content' => 'Add neuro development pic to class
design mat1',
'is_deleted' => 0,
'item_order' => 4
},
{
'has_more_notes' =>
${$VAR1}->{'items'}->[0]->{'has_more_notes'},
'day_order' => 1,
'date_lang' => 'en',
'labels' => [],
'assigned_by_uid' => undef,
'all_day' => ${$VAR1}->{'items'}->[0]->{'all_day'},
'collapsed' => 0,
'parent_id' => undef,
'date_string' => 'Nov 7',
'user_id' => 9494206,
'due_date_utc' => 'Mon 07 Nov 2016 15:59:59 +0000',
'id' => 64426670,
'priority' => 1,
'in_history' => 0,
'responsible_uid' => undef,
'date_added' => 'Fri 04 Nov 2016 07:30:41 +0000',
'project_id' => 182640305,
'item_order' => 8,
'is_deleted' => 0,
'sync_id' => undef,
'content' => 'Make RPI tablet',
'is_archived' => 0,
'checked' => 0,
'indent' => 1
}
],
--
Derrick Cope
--from my mutt
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/