Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: No such file or directory

by rowdog (Curate)
on Sep 30, 2010 at 22:44 UTC ( #862874=note: print w/ replies, xml ) Need Help??


in reply to No such file or directory

I'm not sure about other OSes but Linux requires you to escape spaces in the file name.

my $file = "New\ Text\ Document.txt";

Update: I stand corrected, I'm not sure what I was doing when I reproduced the error but I was wrong in my conclusion. Thanks to Anon for catching my error.


Comment on Re: No such file or directory
Download Code
Re^2: No such file or directory
by Anonymous Monk on Sep 30, 2010 at 23:16 UTC
    Nope, neither linux nor perl require escaping of spaces, and escaping spaces like that in perl doesn't actually accomplish anything
    print "New Text Document.txt\n"; print "New\ Text\ Document.txt\n"; __END__ New Text Document.txt New Text Document.txt
    Now shells on the other hand require that you quote quote your filenames....

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://862874]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2015-07-04 00:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (57 votes), past polls