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

Re^4: Perl Module Problems

by davidov0009 (Scribe)
on Sep 24, 2006 at 17:25 UTC ( [id://574610]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Perl Module Problems
in thread Perl Module Problems

So that has created a hash named %maps, storing the arrays returned by my subroutine? My sub returns an array named @maps regardless of the arg passed to it, does create a conflict? How do I access these arrays that are stored within a hash?

Replies are listed 'Best First'.
Re^5: Perl Module Problems
by ikegami (Patriarch) on Sep 25, 2006 at 03:31 UTC
    It should have been $maps{$game} = [ HLDS::GameMaps("$game") ]; (Note the square brackets). The square brackets create an array from the list returned by GameMaps, and returns a reference to that array. The reference is then stored in the hash. @{$maps{$game}} is the array of maps for game $game.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (1)
As of 2024-04-25 00:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found