Adam Baranyai
Adam Baranyai

Reputation: 3867

What does this mean in Perl?

I am converting some Perl code to php, and I've stumbled on something, which I don't know for sure what it is.

if(!$continenttxt_cached{$savedcontinentid.'_'.$savedcountrygroupid})

What does the {} bracket do here? Is this a standard array element accessed this way? Because I am converting only a small part of a rather large code, I can't find how was $continenttxt_cached defined, so I can only presume this is an array. Is the {} used for something else in Perl?

Upvotes: 1

Views: 80

Answers (1)

Sobrique
Sobrique

Reputation: 53508

{} in this context denotes a hash accessor - hashes are key-value pairs.

So you have a hash called %continenttxt_cached from which you're trying to extract the value associated with $savedcontinentid.'_'.$savedcountrygroupid

See perldata for more information.

Upvotes: 6

Related Questions