KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
In order to list pathes in Windows,I wrote below Perl function(executed under StrawBerry runtime environment). sub listpath { my $path = shift; my @list = glob "$path/*"; #my @list = <$path/*>; my @pathes = grep { -d and $_ ne "." and $_ ne ".." } @list; } But it can't parse directory including space correctly, for example: When I issued following code: listpath("e:/test/test1/test11/test111/test1111/test11111 - Copy"); The function returned an array including two elements: 1: e:/test/test1/test11/test111/test1111/test11111 2: - I am wondering if glob could parse above space directories. Thanks a lot.
Tags (comma-separated)
Save Edits
Cancel