in reply to Re^2: Perl Module Problems
in thread Perl Module Problems
my @maps_$game = HLDS::GameMaps("$game");
You already were told that it's a bad idea to use a variable as a variable name. In this case it's better to use a hash:
my @games=qw( cstrike dod czero gearbox ricochet dmc tfc valve ); my %maps; foreach my $game (@games) { $maps{$game} = HLDS::GameMaps("$game"); } ## Visualize the data structure use Data::Dumper; print Dumper \%maps;
--
David Serrano
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Perl Module Problems
by davidov0009 (Scribe) on Sep 24, 2006 at 17:25 UTC | |
by ikegami (Patriarch) on Sep 25, 2006 at 03:31 UTC |