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)

  OpSys: Ubuntu 18.04; Perl: Perl 5, version 26, subversion 1 (v5.26.1) built for x86_64-linux-gnu-thread-multi (with 67 registered patches)

In reply to Ubuntu File Names with spaces and special characters by EigenFunctions

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.