Dan Muey wrote:
>>> @filelist = glob("w:/stleg/Colorado/House_98/*.htm");
>>> 
>>> And when I rename the directory to "House 98" (space instead of
>>> underscore), the following does not:
>>> 
> 
> 
> The reason is you escaped the space in $MyLoc but not in /House 98/.
> If you escape the space in /House 98/ (IE /House\ 98/) like you did
> in $MyLoc it will probably work. Likewise if you Unescape $MyLoc (IE
>                                                                             my 
> $MyLoc = "d:/00Common Perl/"; ^ no slash here)
> It will probably fail.
> 
> HTH
> 
> DMuey
        Understood, but I know that the space within a directory name must have the \ 
otherwise it won't work, but if I try say ( for my testing purposes):

$MyLoc = "d:/00Common\ Perl/";
@filelist = glob($MyLoc . "pl0*.pl");

        The only thing that prints is 
d:/00Common
        and nothing else.
        I also tried:
@filelist = glob("d:/00Common\ Perl/pl0*.pl");

        It had the same results of D:/00Common

        So it may have something to do with how the glob parses the input passed to 
it. 

        If someone can show us, I would be greatly appreciated since I thought that I 
only need escape to make it work.

        Note: I went into File::Glob and it gives the following:


Since v5.6.0, Perl's CORE::glob() is implemented in terms of bsd_glob().
Note that they don't share the same prototype--CORE::glob() only accepts
a single argument.  Due to historical reasons, CORE::glob() will also
split its argument on whitespace, treating it as multiple patterns,
whereas bsd_glob() considers them as one pattern.

        So I did the following:

use File::Glob qw(:globally :glob);

@filelist = bsd_glob("d:/00Common\ Perl/pl0*.pl", GLOB_QUOTE);
foreach ( @filelist ) {
    printf "%-s\n", $_;
 }

Now it will work as it should and displays the files as it should. Itried without the 
GLBO_QUOTE and it gave the same results.  Just a fyi.

Wags ;)



**********************************************************
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.
****************************************************************


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to