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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T17:45:31+00:00 2026-06-17T17:45:31+00:00

Please help me resolve this issue pre_package_config.pm use strict; our %pre_pkg_configs; $pre_pkg_configs{locDbList}=[‘default’,’default_test’]; second.pl #!/usr/bin/perl

  • 0

Please help me resolve this issue

pre_package_config.pm

use strict;
our %pre_pkg_configs;

$pre_pkg_configs{locDbList}=['default','default_test'];

second.pl

#!/usr/bin/perl
use Expect;
use strict;

our %pre_pkg_configs;

my  $pre_pkg_file = './pre_package_config.pm';

eval {require $pre_pkg_file};

foreach my $db ( $pre_pkg_configs{locDbList} ){
    print $db;
}

Output:

ARRAY (0x10092ae88)

Should have been:

default
default_test

  • 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-06-17T17:45:32+00:00Added an answer on June 17, 2026 at 5:45 pm

    $pre_pkg_configs{locDbList} is a single (scalar) value. Iterating over it would simply give you that one value (which happens to be a reference to an array). If you want to iterate over the contents of that array, you need to dereference:

    for my $db (@{ $pre_pkg_configs{locDbList} }) {
        print $db;
    }
    

    Note that this will output defaultdefault_test, not default default_test. The easiest way to get the latter would be:

    print join(" ", @{ $pre_pkg_configs{locDbList} }), "\n";
    

    To learn more about references, see perldoc perlreftut.
    (Also, you should use warnings; in every file in addition to use strict;.)

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

Sidebar

Related Questions

I have got one issue. Can some one please help me to resolve this?
please help me to resolve this issue i have a view controller in a
Please help resolve this issue. the clear marker is working in FF & IE
Can anybody please help me to resolve this simple issue..How to clear the selection
Please help me somebody to convert unicodestring into string This is how i am
Please help me with this update query. I COMPLETELY understand how redundant this is
please help me arrange these 3 buttons horizontally like this photoshopped image: Please take
Please help me to figure this out. I am having two tab bar items
I am new to Xcode and objective C programming.Please help me to resolve the
please help me. I want know about what types of flags to run an

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.