Created
January 31, 2013 00:12
-
-
Save riywo/4678650 to your computer and use it in GitHub Desktop.
Open a file with read and write mode or create the file if it does not exist in Perl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ls | |
$ perl -e 'open my $fh, "+<", "hoge" or die $!' | |
No such file or directory at -e line 1. | |
$ ls | |
$ perl -MFcntl -e 'sysopen my $fh, "hoge", O_RDWR|O_CREAT or die $!' | |
$ ls | |
hoge |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment