my $fh; open( $fh, '+<', "./test.txt" ) or die $!; my @contents = <$fh>; # print "@contents\n"; close( $fh );