#!/usr/bin/env perl use 5.010; use strict; use warnings; use autodie; { say "\n*** Test +< (r+)"; say 'Open file'; open my $fh, '+<', 'test1.txt'; say 'Position in file: ', tell $fh; say 'Read to end of file'; print while <$fh>; say 'Position in file: ', tell $fh; } { say "\n*** Test +> (w+)"; say 'Open file'; open my $fh, '+>', 'for_del.txt'; say 'Position in file: ', tell $fh; say 'Read to end of file'; print while <$fh>; say 'Position in file: ', tell $fh; } { say "\n*** Test +>> (a+)"; say 'Open file'; open my $fh, '+>>', 'testq.txt'; say 'Position in file: ', tell $fh; say 'Read to end of file'; print while <$fh>; say 'Position in file: ', tell $fh; say 'Write a record'; say $fh 'r'; say 'Position in file: ', tell $fh; say 'Rewind to start of file'; seek $fh, 0, 0; say 'Position in file: ', tell $fh; say 'Read to end of file'; print while <$fh>; say 'Position in file: ', tell $fh; }