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?
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.
| [reply] [d/l] [select] |
|