Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: printing to filehandle contained in a hash

by crashtest (Curate)
on Feb 20, 2010 at 01:39 UTC ( #824307=note: print w/replies, xml ) Need Help??


in reply to printing to filehandle contained in a hash

Hash keys are stringified. When you used the file handle reference as hash key, perl turned it into a string representation of the reference. The reference itself is gone!

Perhaps a hash wasn't the right choice for your data structure. Since all you're doing is iterating over your data anyway, perhaps an array of arrays (AoA) would be more useful. Untested:

# Somewhere earlier... my @radar = (); push @radar, [$fileh, $repoch] for (1..5); # ... then: for (@radar){ my ($fileh, $repoch) = @$_; # ... continue as before. }

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://824307]
help
Chatterbox?
[usemodperl]: i even tried to run perl again from inside script with qx and the working one liner: nada
[Corion]: Maybe the Perl you try stand-alone and the Perl you run are different?

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (7)
As of 2018-06-23 12:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?



    Results (125 votes). Check out past polls.

    Notices?