in reply to subroutine array empty
Just a side note: since the caller knows which directory is supposed to be scanned (and should also know that it's looking only for files whose names match "*.mp3" or something to that effect), there's no need for a subroutine call.
The code that would call your subroutine could just do this instead:
(assuming that $path is what would have been passed when calling your subroutine). That use of angle brackets in perl is referred to as a "file glob".my @mp3files = <$path/*.mp3>;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: subroutine array empty
by davidov0009 (Scribe) on Dec 09, 2007 at 04:47 UTC |