dais has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl use Getopt::Std; use File::Find; getopts('i:'); $file_serch= $opt_i; $dir = "/MYDIR/"; find(\&edits, $dir); sub edits() { $pos = rindex $File::Find::name,'/'; $file_name = substr($File::Find::name,$pos+1,length($File::Find::n +ame)); $in_file = $file_name if ($file_name=~ m/^$file_serch/); exit if $in_file ne ""; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Get latest file based on name
by Corion (Patriarch) on Aug 16, 2010 at 12:48 UTC | |
|
Re: Get latest file based on name
by dasgar (Priest) on Aug 16, 2010 at 15:57 UTC |