Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

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

by turnstep (Parson)
on Apr 28, 2000 at 22:10 UTC ( #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? - Answer 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
Replies are listed 'Best First'.
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 all is quiet...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (2)
As of 2016-12-04 04:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (61 votes). Check out past polls.