in reply to Re^2: Can't use string ("langLogin") as a HASH ref while "strict refs"
in thread Can't use string ("langLogin") as a HASH ref while "strict refs"

Oy. Symbolic references. You really should not do that. A much better strategy would be to use a hash of hashes instead.

If you're absolutely intent on doing it with symrefs, though, you'll need to turn off strict mode. I reccomend confining the non-strict code to the smallest possible block. Something like this should work.

my %lang; { no strict 'refs'; %lang = %{'lang' . $ARGS{lang}}; }
  • Comment on Re^3: Can't use string ("langLogin") as a HASH ref while "strict refs"
  • Download Code

Replies are listed 'Best First'.
Re^4: Can't use string ("langLogin") as a HASH ref while "strict refs"
by Anonymous Monk on Jan 23, 2006 at 11:23 UTC
    That's the only way I can get it to work, with no strict 'refs'... i've modified my language file to be a hash of hashes, instead of a seperate hash for each module and it works much better and strict is turned on full... which makes me alot happier! Thank you so much for all you help! Have an awesome day or night depending where you are!