Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: MP3 Sorter

by em (Scribe)
on Dec 29, 2002 at 23:18 UTC ( #222968=note: print w/replies, xml ) Need Help??


in reply to MP3 Sorter

Just a couple points:

Perl will usually 'do the right thing' if you use '/' as the directory separator. This way I can use your script on my linux box and Mac OS X laptop as well as my W2K system without edits:

chdir "d:/music/new";
is the same as
chdir "d:\\music\\new";

Instead of hard coding the directory (or using Getopt::*), you could do:

my $music_dir = shift || "d:/music/new"; chdir $music_dir;

Which allows 'mp3_sorter.pl' (to process d:\music\new) as well as 'mp3_sorter.pl /Volumes/myafp/mp3' (to process the mp3s on an AppleTalk share).

For little hacks, I'll embed string constants. But I try to make it easy to override them if at all possible.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (4)
As of 2023-06-02 09:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?