in reply to Hash question
The correct syntax would be:
Now, to access the %course hash, you need to index it by a key. Hashes require the use of braces "{}" for indexing (aka subscripting). for example,my %course =( "2CPR2B" => "C Language", "4PL400" => "Perl Language");
Would print out "C Language".print $course{"2CPR2B"}, "\n";
See List value constructors for more information on how to populate hashes, and extract from them.
The "subscripts" section of "perldoc perldata" has information on the syntax of hash subscripts.
"I'm fairly sure if they took porn off the Internet, there'd only be one website left, and it'd be called 'Bring Back the Porn!'"
-- Dr. Cox, Scrubs
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Hash question
by spencerr1 (Novice) on Apr 13, 2013 at 18:30 UTC |