in reply to Re: Is it possible to control scalar(%h) when %h is a tied hash?
in thread Is it possible to control scalar(%h) when %h is a tied hash?

Unfortunately, since I'm calling code in an external module, I can't really change it. Or rather, I can, but subclassing and doing a cut-and-paste of the whole large function is what I was trying to avoid doing by passing in a tied hash.
-- @/=map{[/./g]}qw/.h_nJ Xapou cets krht ele_ r_ra/; map{y/X_/\n /;print}map{pop@$_}@/for@/
  • Comment on Re^2: Is it possible to control scalar(%h) when %h is a tied hash?
  • Download Code

Replies are listed 'Best First'.
Re^3: Is it possible to control scalar(%h) when %h is a tied hash?
by BUU (Prior) on Oct 20, 2004 at 04:43 UTC
    You missed what he is saying. If you are using a version greater than 5.8.3, you can add a method, SCALAR, that gets called in exactly the circumstance you were asking about. No changing the module at all. (I haven't tested it, blah blah, just going off what the parent said, etc).
      Oh, no, I got that, but am stuck on an ActivePerl build of 5.6.1. I should have made it explicit when replying to someone mentioning SCALAR. (which, I'll admit, I didn't know about)
      -- @/=map{[/./g]}qw/.h_nJ Xapou cets krht ele_ r_ra/; map{y/X_/\n /;print}map{pop@$_}@/for@/