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`;
5 回复
  1. pracownia reklamy says:

    You actually make it seem really easy together with
    your presentation but I in finding this matter to be actually one
    thing which I believe I’d never understand. It kind of feels too complex and extremely broad for me. I am taking a look forward in your next submit, I’ll try to get
    the cling of it!

  2. how to take out cellulite in photoshop says:

    Thanks for the marvelous posting! I certainly enjoyed reading it, you will be a great author.

    I will make certain to bookmark your blog and definitely will come back down the road.

    I want to encourage you to ultimately continue your great job, have a
    nice afternoon!

评论已关闭。