文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>perl 文件遍历

perl 文件遍历

时间:2011-01-05  来源:heut2009

#!/usr/bin/perl use strict; my $dir = $ARGV[0];
&fun ($dir);
sub fun () {   my $current = shift;   opendir DIR, $current or die "can not open dir";   my @ list = readdir DIR;   foreach my $item (@list)   {     if (-f $current."/".$item)       {         print $item." is a file\n";       }     else       {         if (-d $current."/".$item && $item ! ~/^[\.]{1, 2}/)           {             print $item." is a directory\n";             &fun ($current."/".$item);           }
      }   } }
相关阅读 更多 +
排行榜 更多 +
百炼英雄抽卡技巧指南

百炼英雄抽卡技巧指南

休闲益智 下载
英雄没有闪滚雷旋风技能如何搭配

英雄没有闪滚雷旋风技能如何搭配

休闲益智 下载
英雄没有闪雷旋风BD构筑推荐

英雄没有闪雷旋风BD构筑推荐

休闲益智 下载