CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Beginner: Re: [karuperl] need help : Edit Log

Chris Charley

May 17, 2018, 4:33 PM

Views: 3554
Re: [karuperl] need help


I realize that my previous reply may not have been so helpful, so I'll try again.

Making a wild guess, perhaps your code looks like this.

if (exists $orra_dta->{$nm_id} && !(exists $orra_dta->{$nm_id}->{'XY_IP_ID'}) { 
$orra_dta->{$nm_id}->{'XY_IP_ID'} = $orra_dta->{$nm_id}->{'ID_NM'};

The first condition exists $orra_dta->{$nm_id} checks to see if '$nm_id' exists as a key in the hash. If it does, then a check is made !(exists $orra_dta->{$nm_id}->{'XY_IP_ID'}) to see if 'XY_IP_ID' doesn't exist in the hash. It checks the first condition before the second condition to avoid auto vivifying the 'first' key before trying the second condition.

If both conditions are true, then an assignment is made, i.e., $orra_dta->{$nm_id}->{'XY_IP_ID'} = $orra_dta->{$nm_id}->{'ID_NM'}

As I said, this is just a guess at what code you are using.

(This post was edited by Chris Charley on May 17, 2018, 4:36 PM)

Edit Log:
Post edited by Chris Charley (User) on May 17, 2018, 4:36 PM

Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives