Shell

shell命令直接作为函数,在Perl中调用。

<pre name="code" class="plain">#!/usr/bin/perl 
use strict; 
use Shell; 

print "now is : ", date(); 
print "current time is : ", date("+%T"); 

my @dirs = ls("-laF"); 
foreach(@dirs) 
{ 
   print if(//$/);#print directory 
} 
exit 0;

 
 


你可能感兴趣的:(Shell)