Ron Bergin wrote:
On Aug 28, 10:10 pm, [EMAIL PROTECTED] (Omega -1911) wrote:
Ha! Here is a snippet that I use on a windows machine. It works!!!

use File::Find;

sub rm();
$count = 0;
@directories = ("F://Hindi/RHTDM");
find(\&rm, @directories);

sub rm() {
$count++;
my ($filename) = $_;
if ($filename =~ /jpg/) {
  print "$count\t$filename\n";
  }
print "\n\n----------- ALL DONE-----------";

Here's a cleaned up version:

use strict;
use warnings;
use File::Find;

my @dir = 'F:/Hindi/RHTDM';
my $cnt;

find( sub{++$cnt and print "$cnt $_\n" if /\.mp3$/}, @dir);
print "\n\n----------- ALL DONE-----------";

That's not cleaned up it's compacted, at the expense of legibility.

I can't see any reason to do this sort of thing to a Perl program
unless you're seriously short of disk space.

Rob

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to