Cockneyphil has asked for the wisdom of the Perl Monks concerning the following question:
This is part of a script which (currently) lists all files in a directory.
How can I alter this script to make it include ONLY the filenames which start with xxxxx ?
How can I alter this script to make it include ONLY the filenames which start with xxxxx ?
opendir THEDIR, "$basepath$ARGV[0]" or die "Unable to open directory: +$!"; my @allfiles = readdir THEDIR; closedir THEDIR; for my $file ( sort { $b <=> $a } @allfiles ) { ..... }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Only files starting with xxxx
by TheHobbit (Pilgrim) on May 11, 2002 at 14:13 UTC | |
Re: Only files starting with xxxx
by choocroot (Friar) on May 11, 2002 at 14:17 UTC | |
Re: Only files starting with xxxx
by fundflow (Chaplain) on May 13, 2002 at 13:33 UTC | |
Re: Only files starting with xxxx
by dsheroh (Monsignor) on May 11, 2002 at 14:11 UTC | |
Re: Only files starting with xxxx
by amitbhosale (Acolyte) on Feb 14, 2008 at 09:04 UTC | |
Re: Only files starting with xxxx
by Cockneyphil (Acolyte) on May 11, 2002 at 14:57 UTC |
Back to
Seekers of Perl Wisdom