Embedded Spaces in Filenames 
Author Message
 Embedded Spaces in Filenames

I'm sure this is an easy one for most, but I cannot understand the
following behavior.

I am reading a directory that includes many long filenames with
embedded spaces, such as "Tax Year 1999.table". I am loading a listbox
with all the files I find.



  {
    if (-f $_)
    {
      insert blah-blah
    }
   }
 when i step through the de{*filter*}, $_ is Tax and then next time through
it is Year, etc
but when I look at $a[0] it is 'Tax Year 1999.table'
I don't understand why $_ does not contain the first list element in
its entirety.

The work around I did looks like this:



        for($i=0; $i<$numfiles; $i++)
        {
                if (-f $a[$i])
                {
                        $lb->insert('end', $a[$i]);
                }
        }

Anyway, I would like to understand.

thanks

Sent via Deja.com http://www.*-*-*.com/
Before you buy.



Sat, 06 Jul 2002 03:00:00 GMT  
 Embedded Spaces in Filenames

Quote:




Two questions:

2.  Why did you post this question in a perl/Tk newsgroup?

--
Marc Dashevsky  (remove "_" from address to reply by e-mail)



Sun, 07 Jul 2002 03:00:00 GMT  
 Embedded Spaces in Filenames


Quote:



> Two questions:



Quote:
> 2.  Why did you post this question in a perl/Tk newsgroup?

I realized last night that this was the wrong place to post this
question. I guess that since my focus is on doing Perl/Tk development
right now,I without thinking about it, posted in the newsgroup I am
spending time looking at this week.

Quote:

> --
> Marc Dashevsky  (remove "_" from address to reply by e-mail)

Sent via Deja.com http://www.deja.com/
Before you buy.


Sun, 07 Jul 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Embedded Spaces in Filenames

2. Embedded spaces in filenames?

3. Win Filenames with embedded blanks

4. embedded blanks in Windows filenames

5. Filenames with embedded $ ???

6. cgi filename arg has embedded "+"

7. spaces in filename

8. Filenames containing spaces

9. open fails with filename starting with space

10. filenames begin with spaces

11. my fix - ActiveState DosGlob.pm on NT4 wont glob filenames with spaces

12. copy files with spaces at the end of filename

 

 
Powered by phpBB® Forum Software