skazat has asked for the wisdom of the Perl Monks concerning the following question:
Yo yo yo yo yo!
I have a config module with all sorts of nice variables and hashes and arrays. Now, we've created a way to override stuff in the default config module by eval'ing a file that can contain some of the same variables in the config module. This file is evaled at the top of the module and everything below looks like this:$foo ||= 'something default and generic"; $bar ||= 'something else common place and a good guess';
This works fine and dandy until I hit a hash or an array, and then I get a polite error, such as:
Can't modify array dereference in logical or assignment (||=)
Which just makes me all frowny. Is there an easy way to have the same sort of functionality that I have with ||= and variables for hashes and arrays? I understand that ||= may work differently within a list context, but I don't know what to use in its place.
thanks for the wisdom,
-justin simoni
!skazat!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: = for lists and hashes?
by RMGir (Prior) on Mar 20, 2002 at 21:01 UTC | |
by hossman (Prior) on Mar 20, 2002 at 21:29 UTC | |
by skazat (Chaplain) on Mar 20, 2002 at 22:58 UTC | |
by skazat (Chaplain) on Mar 20, 2002 at 22:57 UTC | |
|
Re: = for lists and hashes?
by Trimbach (Curate) on Mar 20, 2002 at 21:44 UTC | |
by skazat (Chaplain) on Mar 20, 2002 at 23:01 UTC | |
by rjray (Chaplain) on Mar 21, 2002 at 09:21 UTC |