develooper Front page | perl.beginners | Postings from November 2003

Re: Glob and space in directory name

Thread Previous | Thread Next
From:
R. Joseph Newton
Date:
November 28, 2003 00:54
Subject:
Re: Glob and space in directory name
Message ID:
3FC70DCE.B6727DE9@efn.org
"Wagner, David --- Senior Programmer Analyst --- WGO" wrote:

> Boris Shor wrote:
> > And when I rename the directory to "House 98" (space instead of
> > underscore), the following does not:
> >
> > @filelist = glob("w:/stleg/Colorado/House 98/*.htm");
>         I tried a number of things and was not able to accomplis the task until I split it into two parts: Change to a directory location and then pull the files desired from that location.

Nope.  It's not necessary.  Just remember that the enclosing double-quotes are always a part of Windows long filenames.  When the the sytem processes the string expression offered as an
argument, it takes only the textual content, and strips the quuotes.  Enclose the whole string, including double-quotes, in single quotes.  If you have to do variable intepolation, into the
filename, use the dot conactenation operator instead of implicit conactenation.  Keep the quote characters at the beginining and end of the string in its entirelty, though.

Joseph



Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About