- 论坛徽章:
- 0
|
果然神奇
see
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.
(The following is a comprehensive reference to open(): for a
gentler introduction you may consider perlopentut.)
If FILEHANDLE is an undefined scalar variable (or array or hash
element) the variable is assigned a reference to a new anony-
mous filehandle, otherwise if FILEHANDLE is an expression, its
value is used as the name of the real filehandle wanted. (This
is considered a symbolic reference, so "use strict 'refs'"
should not be in effect.)
If EXPR is omitted, the scalar variable of the same name as the
FILEHANDLE contains the filename. (Note that lexical vari-
ables--those declared with "my"--will not work for this pur-
pose; so if you're using "my", specify EXPR in your call to
open.)
就是说open(FILEHANDLE)相当与
- open(FILEHANDLE,$FILEHANDLE);
复制代码
[ 本帖最后由 churchmice 于 2008-3-10 18:51 编辑 ] |
|