|laziness, impatience, and hubris|
Re: MP3 Sorterby em (Scribe)
|on Dec 29, 2002 at 23:18 UTC ( #222968=note: print w/replies, xml )||Need Help??|
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:
is the same as
Instead of hard coding the directory (or using Getopt::*), you could do:
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.
In Section Cool Uses for Perl