Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
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 the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (1)
As of 2016-08-31 02:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The best thing I ever won in a lottery was:















    Results (426 votes). Check out past polls.