Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Searching for a music files

by dasgar (Priest)
on Aug 12, 2010 at 04:42 UTC ( [id://854573]=note: print w/replies, xml ) Need Help??


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"; } }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://854573]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2024-04-26 05:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found