Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Making a hash of arrays from a datafile

by borisz (Canon)
on Oct 19, 2004 at 22:10 UTC ( #400685=note: print w/replies, xml ) Need Help??


in reply to Making a hash of arrays from a datafile

Your example look fine, just use print Dumper(\%DATAHASH);. and use my instead of local until you know the difference.
Boris

Replies are listed 'Best First'.
Re^2: Making a hash of arrays from a datafile
by redbeard (Beadle) on Oct 19, 2004 at 22:48 UTC
    *slaps self in head* right, of course. That's why the Dumper wasn't working. With respect to local v. my, no, I know what I'm doing here, the DATAHASH is actually declared elsewhere (I was including it here for clarity) and is referenced my multiple subroutines once the data is first read in. Also, the data will never contain commas, so I'm not too worried aobut getting bitten in the arse there. Thanks!
      I know what I'm doing here, the DATAHASH is actually declared elsewhere (I was including it here for clarity) and is referenced my multiple subroutines once the data is first read in.

      This doesn't sound like a compelling reason to use dynamically scoped package variables instead of lexicals. I hate to sound too persnickety, but it's usually advisable to use lexicals by default, and only use package variables when absolutely necessary. So far, you haven't even demonstrated a remote necessity, and your assertion that you "know what [you're] doing" isn't very convincing.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://400685]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2021-05-09 23:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Perl 7 will be out ...





    Results (103 votes). Check out past polls.

    Notices?