in reply to Re^3: RFC:Hacking Tie::File to read complex data
in thread RFC:Hacking Tie::File to read complex data

<quote>It's telling that Dominus didn't actually do the inlining</quote>

Yes, you are right... 1 point for Dominus!... but wait!... look at the FETCH method!!:
sub FETCH { my ($self, $n) = @_; my $rec; # check the defer buffer $rec = $self->{deferred}{$n} if exists $self->{deferred}{$n}; $rec = $self->_fetch($n) unless defined $rec; # inlined _chomp1 substr($rec, - $self->{recseplen}) = "" if defined $rec && $self->{autochomp}; $rec; }
Ohhh!! Inlining ahead!... he falls in the dark side of the coding force!!:
# Chomp one record in-place; return modified record sub _chomp1 { my ($self, $rec) = @_; return $rec unless $self->{autochomp}; return unless defined $rec; substr($rec, - $self->{recseplen}) = ""; $rec; }

:-) Sorry, it is friday!!

Have a nice weekend!! and thanks for your comments!

Cheers!

citromatik