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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T20:49:07+00:00 2026-06-04T20:49:07+00:00

For whatever reason I’m compelled to try some big ordered files processing, I started

  • 0

For whatever reason I’m compelled to try some big ordered files processing, I started my attempt using a hash of files in the following way:

my %fo=();#File operations hash
foreach my $fn("file1","file2","file3","file4"){
        open($fo{$fn}{"if"},"<","$fn") or die ("Error open input file $fn: $!");#Input file
        $fo{$fn}{"v"} = <$fo{$fn}{"if"}>;#read one record
}

So when print Dumper(\%fo) I get:

$VAR1 = {
      'file1' => {
                   'v' => undef,
                   'if' => \*{'::$__ANONIO__'}
                 },
      'file2' => {
                   'v' => 'GLOB(0x8f5f098)',
                   'if' => \*{'::$__ANONIO__'}
                 },
      'file3' => {
                   'v' => undef,
                   'if' => \*{'::$__ANONIO__'}
                 },
      'file4' => {
                   'v' => 'GLOB(0x8edf1e0)',
                   'if' => \*{'::$__ANONIO__'}
                 }
    };

My question is, how do I get the file being read correctly when the “pointer” is a hash? The file is being opened correctly and the files are not empty but I do not find the lines in the Dumper output and I’m not sure how/what to interpret from the GLOB(hash).

Thanks.

  • 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-04T20:49:08+00:00Added an answer on June 4, 2026 at 8:49 pm

    <...> can be a shortcut for both readline(...) and for glob('...'). You want it to be the former, but it’s the latter in this case.

    You could use

    readline( $fo{$fn}{"if"} )
    

    or

    <{$fo{$fn}{"if"}}>          # Add curlies around the expression.
    

    or

    use IO::Handle qw( );       # Not needed in 5.14+
    $fo{$fn}{"if"}->getline()
    

    to solve your problems.

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

Sidebar

Related Questions

I am trying to serve some JavaScript files with Node.js and for whatever reason
For whatever reason, my cucumber is using my _development db instead of my _test
I have a linq query that for whatever reason is not coming back ordered
For whatever reason the following request gets no response from google. However if I
For whatever reason, when I try to run any integration test, I'm getting the
For whatever reason the following: $(function() { $(window).resize(function() { alert(resized!); }); }); only fires
I am trying to get some data through ajax and I for whatever reason,
For whatever reason, ThreadPool 's QueueWorkItem doesn't return an IAsyncResult or some other handle
For whatever reason, the following code isn't working: #import <Foundation/Foundation.h> @interface UIView (FindUIViewControllerParent) -
I'm using a honeycomb device to test my app and for whatever reason the

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.