ChuckularOne has asked for the wisdom of the Perl Monks concerning the following question:
=====================(( U P D A T E ))=====================#! /usr/bin/perl -w $mask = $ARGV[0]; $position = $ARGV[1]; opendir(DIR,"."); my @files = grep { $_ ne '.' && $_ ne '..' }readdir DIR; closedir(DIR); foreach(@files) { if ($_ =~ m/^$mask/ig) { push(@result,$_) } } print "Your file is: ".$result[$position-1]."\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Finding a file by age (Newest First)
by Zaxo (Archbishop) on Jun 04, 2004 at 17:38 UTC | |
by ChuckularOne (Prior) on Jun 04, 2004 at 19:11 UTC | |
|
Re: Finding a file by age (Newest First)
by pbeckingham (Parson) on Jun 04, 2004 at 17:42 UTC | |
|
Re: Finding a file by age (Newest First)
by sacked (Hermit) on Jun 04, 2004 at 17:40 UTC | |
|
Re: Finding a file by age (Newest First)
by gsiems (Deacon) on Jun 04, 2004 at 17:43 UTC | |
by Roy Johnson (Monsignor) on Jun 04, 2004 at 18:38 UTC | |
by dave_the_m (Monsignor) on Jun 04, 2004 at 20:03 UTC |