EigenFunctions has asked for the wisdom of the Perl Monks concerning the following question:
I am making the transition from windoz (win7) to Ubuntu (18.04) and I can't seem to get Perl to understand path/file names. The path and the file names always have spaces and special characters (![]# etc.). I have tried every combination of quoting I could think of and nothing seems to work. I know the file exists because I copy and paste the text on the command line and do an ls -l and the file exists.
Here is some code
: : #my $BibleFullNames = q{~/Aoo/01-Writer/Other/UMC~~ Changewater/[01] +Team Leader- Worship Service/Bible Books, Full Names.txt}; #my $BibleFullNames = q{~/Aoo/01-Writer/Other/UMC\~\~\ Changewater/\[ +01\]\ Team\ Leader-\ Worship\ Service/Bible\ Books,\ Full\ Names.txt} +; #my $BibleFullNames = q{"~/Aoo/01-Writer/Other/UMC~~ Changewater/[01] + Team Leader- Worship Service/Bible Books, Full Names.txt"}; #my $BibleFullNames = q{'~/Aoo/01-Writer/Other/UMC~~ Changewater/[01] + Team Leader- Worship Service/Bible Books, Full Names.txt'}; #my $BibleFullNames = q{"~/Aoo/01-Writer/Other/UMC\~\~\ Changewater/\ +[01\]\ Team\ Leader-\ Worship\ Service/Bible\ Books,\ Full\ Names.txt +"}; my $BibleFullNames = q{'~/Aoo/01-Writer/Other/UMC\~\~\ Changewater/\[ +01\]\ Team\ Leader-\ Worship\ Service/Bible\ Books,\ Full\ Names.txt' +}; : : if (!(-e $BibleFullNames)) { Log2die("**Fatal err, can't find Bible names file (\"$BibleFullNames +\")"); } : :
I would uncomment each variation, one at a time, and then run the program only to see each fail to see the file
Any help would be appreciated
Thanks,
EigenFunctions
OpSys: Win7 x64 Service Pack 1 Professional/Home Premium;
Perl: Strawberry (v5.22.0)/ActiveState (v5.14.2)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Ubuntu File Names with spaces and special characters
by bliako (Abbot) on Feb 26, 2019 at 12:52 UTC | |
by Lotus1 (Vicar) on Feb 27, 2019 at 15:56 UTC | |
by bliako (Abbot) on Feb 28, 2019 at 11:38 UTC | |
by EigenFunctions (Beadle) on Feb 28, 2019 at 13:11 UTC | |
by haukex (Archbishop) on Mar 01, 2019 at 08:35 UTC |