open (DAT, "+>>$file") or die "$!"; #### DB<1> open $fh, '+>>', 'test.dat' DB<2> if ( eof $fh ) { print "Don't try to read, you're at the end!\n" } Don't try to read, you're at the end! DB<3> seek $fh, 0, 0 DB<4> if ( not eof $fh ) { print "Read on, McDuff!\n" } Read on, McDuff! DB<5> @lines = <$fh> DB<6> x @lines DB<7> chomp @lines 0 'First Line' 1 'Second Line' 2 'Last Line'