I'm just wondering if I can get some help with dereferencing in Perl?
I have a while loop where I query DB and repeat what I return. Then I write the data I need to the hash and push the hash into an array. All of this is part of the JSON string.
However, I can only click on the hash link, not the hash (I tried all kinds of things), that is, if the loop goes (for example) 3 times, I get the same thing that appears 3 times in JSON, I try PUT.
Here is the code:
my $json = new JSON::XS;
my $json_text = JSON::XS->new->decode (shift->content);
my $sig_num = 0;
my %sig_hash;
<MySQL Stuff -removed for readability>
while($query_handle->fetch())
{
$sig_num++;
$sig_hash{position} = 'below';
$sig_hash{signature_text} = $sig;
$sig_hash{signature_name} = 'Signature '.$sig_num;
$sig_hash{signature_default} = JSON::XS::true;
push (@{$json_text->{data}->{mail}->{signatures}}, \%sig_hash);
}
return $json_text;
Thanks for any help!
source
share