Dan Anderson wrote:
> When I use:
>
> my @foo = glob "/foo/bar baz/*";
> or
> my @foo = glob "/foo/bar\ baz/*";
>
> Glob doesn't return the files in those directories, @foo equals
> ("/foo/bar");
>
> However, if I do:
>
> my @foo = glob "/foo/bar*baz/*";
>
> @foo equals an array with all the files in "/foo/bar\ baz/", which is
> what I"m trying for.
>
> How do I escape spaces? Perldoc glob doesn't say.
here is one way doing it:
[panda]# touch "foo .txt"
[panda]# perl -MFile::Glob=:glob -le 'print bsd_glob("foo .txt",GLOB_QUOTE)'
foo .txt
[panda]# rm -f "foo .txt"
[panda]# perl -MFile::Glob=:glob -le 'print bsd_glob("foo .txt",GLOB_QUOTE)'
[panda]#
perldoc File::Glob
david
--
$_=q,015001450154015401570040016701570162015401440041,,*,=*|=*_,split+local$";
map{~$_&1&&{$,<<=1,[EMAIL PROTECTED]||3])=>~}}0..s~.~~g-1;*_=*#,
goto=>print+eval
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]