in reply to how to get the parent directory name?
Remember, your current working dir is a global variable, which lots of code relies on (all your open calls, for instance). I've always regretted chdiring around in a script. It's generally easier to work with relative paths from where you are.use File::Spec qw/splitdir/; my @files = glob "*/*/*"; foreach my $file (@files) { my ($artist, $album, $track) = File::Spec->splitdir($file); # Do something to $file using these vars and a module to # get/set tags }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: how to get the parent directory name?
by jhourcle (Prior) on Dec 08, 2006 at 14:09 UTC | |
by Anonymous Monk on Dec 08, 2006 at 14:45 UTC |