>>>>> "PL" == Paul Lalli <> writes:
PL> On Aug 16, 2:29 pm, Uri Guttman <u...@stemsystems.com> wrote:
>> >>>>> "k" == kj <so...@987jk.com.invalid> writes:
>> see my other post. tying is probably even easier than overloading. you
>> just need to create 2 methods that handle the tied interface (a
>> constructor and a readline).
PL> ... uh-huh, and with using overload, you only need the normal
PL> constructor you were going to have anyway, and ONE method to handle
PL> the operator.
well, we are counting the same things, a single constuctor (which is a
class method) and a single operator or readline method. i added tie
support to File::ReadBackwards by putting in two typeglob assignments to
alias the open and readline methods to the names needed by tied
handles. not much work at all and i would say less than if i did
overloading as that needs a mapping structure.
oops, i just checked and it has 5 method aliases. i started with 2 but a
bug/feature report requested eof, close and tell (those also needed new
short methods).
PL> (plus, the OP very specifically said he didn't want to mess with
PL> tying)
that i didn't see. but as i think it is less work, tying should be on
the table. maybe he was scared by what he thought it needed.
uri
--
Uri Guttman ------
--------
http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ----------------------------
http://jobs.perl.org