in reply to Searching for a music files

I would recommend that you check out File::Find. I've only used this once or twice and I'm not too familiar with the *nix find command, so I'm not the best person to explain how to use this module.

Basically, File::Find will search through the file system and take an action on files that meet the criteria that you set.

Replies are listed 'Best First'.
Re^2: Searching for a music files
by Ratazong (Monsignor) on Aug 12, 2010 at 07:16 UTC

    It's really not complicated, but maybe the example code below will help to understand the documentation ...

    Rata

    use strict; use warnings; use File::Find; my $path = "d://changma_ha"; find(\&checkFile, $path); exit 0; sub checkFile { my $fullfilename = $File::Find::name; # with the full path my $filename = $_; # just the filename if ($filename =~ /\.mp3$/ ) # name ends with .mp3 { print "Finally found $fullfilename\n"; } }