perl -wle 'open my $fh, "<", "test.txt"; print $fh "hello"' Filehandle $fh opened only for input at -e line 1.