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 7636475
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T07:41:25+00:00 2026-05-31T07:41:25+00:00

Trying to loop through an array of hashes and getting an error message that

  • 0

Trying to loop through an array of hashes and getting an error message that I don’t understand.

Below is the code that creates the array of hashes, using Dumper It appears to have all every thing in it. And like this it runs fine.

while ($getAdUserInfo->fetch()){

$name = $name || '';
$isactive = $isactive || ''; 
$loginid = $loginid || '';
$account_status = $account_status || '';
$password = $password || '';
#print "$name, $isactive, $loginid, $account_status, $password\n"; 
my %row = (
    name => $name, 
    isactive => $isactive, 
    loginid => $loginid, 
    account_status => $account_status, 
    password => $password,
);
push(@adUserInfo, %row);
}

But if I add this code to loop through it

for my $rowRef (@adUserInfo)  {
print $rowRef->{password};
}

I get this error Can’t use string (“password”) as a HASH ref while “strict refs” in use at adempiereToExo.pl line 64

Now I have done a bit of reading on this error and most of the time it looks like it happens when someone has something in the array that is not a hash ref. But I don’t think that is the case here. I am extremely new to Perl so I could be wrong. Also it is always the last element in the hash that it moans about?

I Know there are a lot of people asking about this error, But I have read through a lot of answers and still cannot figure it out.

  • 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-31T07:41:26+00:00Added an answer on May 31, 2026 at 7:41 am

    Change this:

    push(@adUserInfo, %row);
    

    (which means “expand %row‘s keys and values out into a list, and add all of them to @aduserInfo“; you can add a print "@adUserInfo\n" to get a clearer idea of that) to this:

    push(@adUserInfo, \%row);
    

    (which means “create a reference to %row, and add that reference to @aduserInfo“).

    Also it is always the last element in the hash that it moans about?

    That’s arbitrary. Hashes are unordered, so there’s no concept of a “last element”.

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

Sidebar

Related Questions

I'm getting the following error after shuffling an array, then trying to loop through
I'm using smarty for my site, and I'm trying to loop through an array
In the below code I'm trying to loop through each child node and append
I'm trying to loop through an array of strings using the foreach control, and
I am trying to write PHP code to loop through an array to create
I'm using mvc and I'm trying to loop through a array of checkboxes, but
I am trying to loop through an integer array using C# Iterators. The program
I'm trying to create a function that will loop through an array of various
I'm stuck trying to loop through this array of GPS coordinates that puts pins
I'm trying to make a loop that will recurse through an array of bytes

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.