- 论坛徽章:
- 145
|
回复 1# dxwwp
>> ...该怎么理解...
1. 用shell理解
2. 详解 perldoc
$ perldoc -f open
open FILEHANDLE,EXPR
open FILEHANDLE,MODE,EXPR
open FILEHANDLE,MODE,EXPR,LIST
open FILEHANDLE,MODE,REFERENCE
open FILEHANDLE
Opens the file whose filename is given by EXPR, and associates it
with FILEHANDLE.
Simple examples to open a file for reading:
open(my $fh, "<", "input.txt")
or die "cannot open < input.txt: $!";
and for writing:
open(my $fh, ">", "output.txt")
or die "cannot open > output.txt: $!";
...
.................................................If MODE is ">>", the file is
opened for appending, again being created if necessary.
|
|