in reply to How do I open a file in a path that has spaces in the name?
Second:use strict; use warnings;
I hope that I have made this clear enough.#!/usr/bin/perl # ^ that should work for most Win32 installs use strict; use warnings; my $filename = "c:\\Program Files\\My Projects\\Scripts For Oracle\\te +st1.txt"; test_file($filename); $filename = "c:/Program Files/My Projects/Scripts For Oracle/test2.txt +"; test_file($filename); $filename = 'c:\Program Files\My Projects\Scripts For Oracle\test3.txt +'; test_file($filename); sub test_file { my $filename = shift; open(FILE, "> $filename") || die "Could not open the file $filename +for writing at "; print FILE "testing\n"; close(FILE); }
Originally posted as a Categorized Answer.
|
|---|