<div dir="ltr">In Perl, once you say $a->{$b}->{$c}, $a->{$b} will "spring into existence". From perlref:<div><div><br></div><div><div> The left side of the arrow can be any expression returning a reference, including a</div>
<div> previous dereference. Note that $array[$x] is not the same thing as "$array->[$x]"</div><div> here:</div><div><br></div><div> $array[$x]->{"foo"}->[0] = "January";</div>
<div><br></div><div> This is one of the cases we mentioned earlier in which references could spring into</div><div> existence when in an lvalue context. Before this statement, $array[$x] may have been</div>
<div> undefined. If so, it's automatically defined with a hash reference so that we can look</div><div> up "{"foo"}" in it. Likewise "$array[$x]->{"foo"}" will automatically get defined with</div>
<div> an array reference so that we can look up "[0]" in it. This process is called</div><div> autovivification.</div><div><br></div><div><br></div><div class="gmail_quote">On Sun, Sep 11, 2011 at 4:24 PM, Chanan Berler <span dir="ltr"><<a href="mailto:bc.other@gmail.com">bc.other@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hello All,<br>
<br>
# check if result key GetUmsPlayerData found<br>
if ( exists($result->{'response'}->{'Player'}->{'GetUmsPlayerData'}->{'player_data'})<br>
)<br>
{<br>
# $result->{'response'}->{'Player'}->{'GetUmsPlayerData'}->{'player_data'}<br>
= $self->_player_data_by_key_to_name_($result->{'response'}->{'Player'});<br>
}<br>
<br>
Funny after adding this condition (see no action is done - comments)<br>
and printing using Data::Dumper i found this:<br>
<br>
Sep 11 13:18:17 <a href="http://dev-host-03.playtechtv.tv" target="_blank">dev-host-03.playtechtv.tv</a>: [pid:26150] [debug]<br>
[mixtv::payment::PlaytechUMS_base::_PARSE_RESPONSE_] response returned<br>
with error (0). system-error-code was set to 100.<br>
Sep 11 13:18:17 <a href="http://dev-host-03.playtechtv.tv" target="_blank">dev-host-03.playtechtv.tv</a>: [pid:26150] [debug]<br>
[mixtv::payment::PlaytechUMS_base::_simple_trace_] =========><br>
params=$VAR1 = { 'req_ref' => '7864384', 'req_name' => 'LOGIN', 'data'<br>
=> { 'Player' => { 'errorText' => '', 'errorCode' => '0',<br>
'GetUmsPlayerData' => {}, 'Login' => { 'sessionToken' =><br>
'1DC46A42BAFD44A4714F6C33FBBA84CE', 'sessionValidationData' => undef,<br>
'errorText' => '', 'errorCode' => '0', 'playerCode' => '2752191',<br>
'phone' => undef, 'username' => 'MBTEST10' } } }, 'type' => 'RESPONSE'<br>
};<br>
<br>
Notice GetUmsPlayerData was added to my Hash ?? is this a memory<br>
problem with exists ? checking same thing using defined i found same<br>
problem :-(<br>
<br>
-Chanan<br>
<font color="#888888"><br>
<br>
--<br>
===================<br>
---- Chanan Berler ----<br>
===================<br>
_______________________________________________<br>
Perl mailing list<br>
<a href="mailto:Perl@perl.org.il">Perl@perl.org.il</a><br>
<a href="http://mail.perl.org.il/mailman/listinfo/perl" target="_blank">http://mail.perl.org.il/mailman/listinfo/perl</a></font></blockquote></div><br><br clear="all"><div><br></div>-- <br>Gaal Yahas <<a href="mailto:gaal@forum2.org">gaal@forum2.org</a>><br>
<a href="http://gaal.livejournal.com/">http://gaal.livejournal.com/</a><br>
</div></div></div>