#!/usr/bin/perl
open TEMP, "<temp.txt";
while (<TEMP>) {
print "$_";}
./handle.pl
hello world
hello perl
#!/usr/bin/perl
open TEMP, ">temp.txt";
print TEMP "--------------------";
open TEMP, "<", "temp.txt";
open TEMP, ">", "temp.txt";
open TEMP, ">>", "temp.txt";
my $ret = open TEMP, ">>/etc/sudoers";
if (!ret) {
# open 失败
...
}
欢迎光临 曲径通幽论坛 (http://www.groad.net/bbs/) | Powered by Discuz! X3.2 |