in reply to Re^3: Working with a unkown number of arrays
in thread Working with a unkown number of arrays
/\.\d+/
And based on the patterns (examples) he gave before, I don't think we can assume there's a dot, but we do know the numbers are at the end. Therefore:
/\d+$/
Furthermore, the whole thing can be reduced to this:
my @directories = grep { /\d+$/ and -d $_ } readdir DIR;
although that doesn't do the print. But I don't think that's necessary.
|
|---|