Skip to content

Instantly share code, notes, and snippets.

@satomixx
Created April 2, 2013 05:34
Show Gist options
  • Save satomixx/5290151 to your computer and use it in GitHub Desktop.
Save satomixx/5290151 to your computer and use it in GitHub Desktop.
スゲい簡単なPerl入門 -5thDay @_ $_ ref: http://qiita.com/items/4e6f35905122c5505d99
sub fileProc{
#もしいま注目しているファイルやディレクトリがファイルとして存在したら、
#$File::Finde::nameします
print "$File::Find::name\n" if -f $_;
}
#!/usr/bin/perl -w
use File::Find;
find(\&fileProc,'.');
sub fileProc{
# もし$_というファイルが存在しなければメソッドを脱出
return unless -f $_;
print "$File::Find::name\n"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment