Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6916305
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:35:07+00:00 2026-05-27T09:35:07+00:00

So I tripped across another oddity in translating the old developers Perl script into

  • 0

So I tripped across another oddity in translating the old developers Perl script into
Object Orientated PHP, this little Perl reference statement has had me scratching my
head for quite a while, but I haven’t been able to figure it out via Google or friends.

I’ve tried my best to write out what I believe it to mean, but am uncertain if it is
right. Could someone tell me if I figured it out or if I’m off? Thanks ahead of time.

The perl snippet is:

!$state->{$msg->{hash}}

I believe it means one of the two of these in OO PHP?

!$this->state[$this->msg['hash']] //or?
$this->state != $this->msg['hash']

Am I even in the ballpark?

UPDATE I was told this is a has reference, not an array reference, but I’m uncertain since $msg->{grey}, $msg->{hash}, $msg->{domain} etc all exist in the same sub?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T09:35:07+00:00Added an answer on May 27, 2026 at 9:35 am

    Actually, on a second glance, $state is a hash reference of some kind (although it could also be a blessed object of some class), and $state->{$msg->{hash}} is the value of %$state corresponding to the key $msg->{hash} (which, in turn, is the value of %$msg that corresponds to the key "hash").

    So, assuming that $state and $msg are only hash references (and not specific objects), they actually correspond to arrays in PHP (one of the really dumb things about PHP is that there is no difference between an array and an associative array).

    So, it would be !$state[$msg['hash']] in PHP.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Still learning the ropes with Groovy, this problem has tripped me up since last
As a new .net/C# web begginner, I always get tripped up when I try
While trying to do something a bit more complicated, I ran across a behavior
I'm trying to modify a stored procedure hooked into an ORM tool. I want
I hate triggers. I've been tripped up by them way too many times. But
I've got this class, let's call it Refund (because that's what it's called). I
I'm running into some issues with boost::bind and creating threads. Essentially, I would like
How can you make an own function in PHP such that I can bind
Quick question about Ruby forking - I ran across a bit of forking code
I probably should go to Server Fault with this, but I don't know how

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.