Categorized | Biocompute

perl:使用system函数

Posted on 22 五月 2009 by 柳城 ,阅读 783 简洁版 繁體

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`;

延伸阅读:

  1. Perl chr函数
  2. Perl:用File::Basename来获取文件名
  3. Perl split函数
  4. Perl closedir函数
  5. Perl chdir函数

转载请注明 : 来源于 perl:使用system函数 | 柳城博客

相关主题

Leave a Reply

[强] [握手] [可爱] [ok] [呲牙] :) [偷笑] [流泪] [疑问] [亲亲] [擦汗] [得意] [衰] [可怜] [抱拳] [大兵] more »

Advertise Here

最新评论

Lc.live