Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Answer: How do you open a filehandle to a DOS file which has spaces in the filename?

( #9616=categorized answer: print w/ replies, xml ) Need Help??

Q&A > input and output > How do you open a filehandle to a DOS file which has spaces in the filename? contributed by turnstep

Just quote it and everything will be fine:
open (SPACEY, "this file has spaces.txt") || die;

Comment on Answer: How do you open a filehandle to a DOS file which has spaces in the filename?
Download Code
Re: Answer: How do you open a filehandle to a DOS file which has spaces in the filename?
by scottstef (Curate) on Mar 15, 2001 at 10:00 UTC
    Thanks a lot, i also dealt with issue for several hours and could not find a solution in any of my manuals. Wish I knew how to use the search feature a little better when i wrote this code.
      my $filename = "this file has spaces.txt" open (SPACEY, "$filename") || die;
      Hardcoded filenames are unwise. Shouldn't the above work also? Didn't seem to.
Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (14)
As of 2014-07-30 17:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (237 votes), past polls