Another solution would be to replace the glob() statement with a readdir and
then compare the filenames like this:

my @files;
my @matches;
chdir "L:/Desks/Agency Passthru Trading/Reports/" || die "Could not change
to directory!";
opendir(DIR,".") || die "Could not open directory for reading!";
@files = readdir(DIR);
while(shift @files){
   if($_ =~ /Mortgage Market Review Package/i){
      push @matches,$_;
   }
}

print "Here are the matching files:\n";
foreach $match(@matches){
   print "   $match\n";
}

It makes your code a little longer, but I think it should work. (I haven't
tried this since I don't have access to my regular materials).

-----Original Message-----
From: Nikola Janceski
To: 'McCollum, Frank'; [EMAIL PROTECTED]
Sent: 1/28/02 1:25 PM
Subject: RE: Matching for filenames  with spaces in them?

The only solution (and it's not a good one) is to replace all the spaces
with a ? (question mark).

-----Original Message-----
From: McCollum, Frank [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 28, 2002 4:10 PM
To: [EMAIL PROTECTED]
Subject: Matching for filenames with spaces in them?




I asked this earlier but got no response, so all that is different is
the
subject.  Surely, there is some one in this group who can answer this
seemingly simple problem!  -Frank

> I am guessing that the spaces are the problem, because if I put the
same
> string in the Windows Find tool, I get the same unexpected results.  I
> have this code below and expect to get the file named... "Mortgage
Market
> Review Package (25 Jan        ", but instead I get a single word,
> "Market", which is not a file.  Any insight into this?  (I've tried
with
> an without the "\" in front of the spaces)
> 
> 
>       chdir "L:/Desks/Agency\ Passthru\ Trading/Reports/";
>       $myNewFile =  glob "*Mortgage\ Market\ Review\ Package*" ;
>       print "$myNewFile\n";
> 
> 
> 
> Thanks,
> Frank McCollum
> Bank Of America Securities, LLC
> [EMAIL PROTECTED]
> (704) 388-8894
> 

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

------------------------------------------------------------------------
----
--------------------
The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


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


--------------------------------------------------------------------------------
This email may contain confidential and privileged 
material for the sole use of the intended recipient. 
If you are not the intended recipient, please contact 
the sender and delete all copies.

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

Reply via email to