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>;
In reply to Re: subroutine array empty
by graff
in thread subroutine array empty
by davidov0009
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |