Created
December 24, 2010 10:39
-
-
Save taiyoh/754099 to your computer and use it in GitHub Desktop.
modify file with no module
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
#!perl -w | |
use strict; | |
use utf8; | |
open my $f, '<', 'a.txt'; | |
flock($f, 2); | |
my $data = <$f>; | |
chomp $data; | |
open $f, '+>', 'a.txt'; | |
print $f 'abc'; | |
close $f; | |
__DATA__ | |
@a.txt | |
abcde |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment