柳城.Name's Archivers

From 柳城 on 2009-05-22 16:48:33

perl:使用system函数

system函数使用介绍
#!/usr/bin/perl -w
$stant=system("ls");
print "$stant\n";

$well=system "'date'";
print "three:$well\n-------------\n";

@hello=("echo","hello,world!");
system(@hello);
 

`` 也可以用的
一个简单的例子:
#!/usr/bin/perl -w
@a=`ls /root` ;
foreach ( @a ) {
print $_ ;
}
 

直接输出
print `ls /root`;

查看完整版本: perl:使用system函数

Tags: perl, system函数


Copyright © 2008-2009 柳城博客 | 中文NCBI | Lc-Archivers