thefid has asked for the wisdom of the Perl Monks concerning the following question:
I receive an error when I try and test the code: Can't locate object method "Office" via package "Hours". At first I thought it must be an error that Sriram left out the quotes, but I could not find it in the errata I always use quotes or string variables as keys and will continue to do so, but is the above code an error or not? Further testing:$curr_prof->{Office Hours} = interval_parse($1);
okay!$baseball_team{Seattle} = "Mariners";
error!$baseball_team{Los Angeles} = "Dodgers";
okay!$la = "Los Angeles"; $baseball_team{$la} = "Dodgers";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(jeffa) Re: using quotes in hash keys
by jeffa (Bishop) on Mar 27, 2001 at 02:23 UTC | |
by Xxaxx (Monk) on Mar 27, 2001 at 17:39 UTC | |
|
Re: using quotes in hash keys
by tadman (Prior) on Apr 24, 2001 at 19:42 UTC | |
by John M. Dlugosz (Monsignor) on Jul 07, 2001 at 21:45 UTC | |
by tadman (Prior) on Jul 08, 2001 at 18:30 UTC | |
by John M. Dlugosz (Monsignor) on Jul 08, 2001 at 21:19 UTC |