- 论坛徽章:
- 46
|
本帖最后由 zhlong8 于 2010-11-04 11:58 编辑
$str = `dir`
$str 里面即为 dir 的内容,注意是反引号
qx/STRING/
`STRING`
A string which is (possibly) interpolated and then executed as a system command with /bin/sh or its equivalent. Shell wildcards, pipes, and redirections will be honored. The collected standard output of the command is returned; standard error is unaffected. In scalar context, it comes back as a single (potentially multi-line) string, or undef if the command failed. In list context, returns a list of lines (however you've defined lines with $/ or $INPUT_RECORD_SEPARATOR), or an empty list if the command failed.
见 perlop |
|