test.pl: use Tie::File; use Data::Dumper; my $self = tie @array, "Tie::File", "test.pl"; print Dumper($self); print $array[2]; print Dumper($self); #### $VAR1 = bless( { 'autochomp' => 1, 'mode' => 258, 'deferred_s' => 0, 'autodefer_threshhold' => 3, 'sawlastrec' => undef, 'defer' => 0, 'dw_size' => 2097152, 'offsets' => [ 0 ], 'deferred_max' => -1, 'autodeferring' => 0, 'recsep' => ' ', 'rdonly' => '', 'memory' => 2097152, 'filename' => 'test.pl', 'fh' => \*Tie::File::FH, 'ad_history' => [], 'autodefer' => 1, 'deferred' => {}, 'autodefer_filelen_threshhold' => 65536, 'recseplen' => 2, 'cache' => bless( [ bless( [ [ 0, $VAR1->{'cache'}, 0 ] ], 'Tie::File::Heap' ), {}, 2097152, 0 ], 'Tie::File::Cache' ) }, 'Tie::File' ); $VAR1 = bless( { 'autochomp' => 1, 'mode' => 258, 'deferred_s' => 0, 'autodefer_threshhold' => 3, 'sawlastrec' => undef, 'defer' => 0, 'dw_size' => 2097152, 'offsets' => [ 0, '16', '35' ], 'deferred_max' => -1, 'autodeferring' => 0, 'recsep' => ' ', 'rdonly' => '', 'memory' => 2097152, 'filename' => 'test.pl', 'fh' => \*Tie::File::FH, 'ad_history' => [], 'autodefer' => 1, 'deferred' => {}, 'autodefer_filelen_threshhold' => 65536, 'recseplen' => 2, 'cache' => bless( [ bless( [ [ 1, $VAR1->{'cache'}, 1 ], [ 0, 2, ' ' ] ], 'Tie::File::Heap' ), { '2' => 1 }, 2097152, 2 ], 'Tie::File::Cache' ) }, 'Tie::File' );