in reply to Re: Tie() and substr(), proposal for SUBSTR tie object method
in thread Tie() and substr(), proposal for SUBSTR tie object method

Did you even read the OPs reasons for suggesting special handling for substr? If you had, you would have suggested only FETCHVEC.
  • Comment on Re^2: Tie() and substr(), proposal for SUBSTR tie object method

Replies are listed 'Best First'.
Re^3: Tie() and substr(), proposal for SUBSTR tie object method
by ambrus (Abbot) on Jul 03, 2005 at 12:40 UTC

    You are right.

    But seriously, I think this isn't the task of tie, rather, it's that of operator overloading. Besides the stringification operator, there could be an overloadable substr operator, which would return a part of the string. (Similarly there could be a print operator too, which would print the object. The match and kill thingy is stupid.) Then, the tied variable (which could be scalar, or array etc) could return an overloaded object. This, however, is probably still not a very good idea because, as dave_the_m explained, it would cause incomaptibilities.