Created
April 2, 2013 05:34
-
-
Save satomixx/5290151 to your computer and use it in GitHub Desktop.
スゲい簡単なPerl入門 -5thDay @_ $_ ref: http://qiita.com/items/4e6f35905122c5505d99
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sub fileProc{ | |
#もしいま注目しているファイルやディレクトリがファイルとして存在したら、 | |
#$File::Finde::nameします | |
print "$File::Find::name\n" if -f $_; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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