in reply to Win file/dir names w/spaces

OK. Finally. Here's my real question.

What's the difference between the strings $dfull in test2 and $full in test 3? I know that $full did not print correctly in test3 because it was single quoted in the print statement. But that is really part of my question. What is different about a string that parses correctly with or without single quotes. I understand that double quotes trigger interpolation. But single quotes don't do that. What do they do?

Replies are listed 'Best First'.
Re^2: Win file/dir names w/spaces
by AnomalousMonk (Archbishop) on Mar 22, 2014 at 23:47 UTC
    What's the difference between the strings $dfull in test2 and $full in test 3?

    Just to retrace your steps a bit, do you understand the difference between  $dfull in dirtest2 and  $full also in dirtest2? Had strictures (see strict) been enabled, Perl would have refused to compile  $full because it was not pre-defined. Without strictures but with warnings enabled, Perl would have told you that  $full was undefined wherever you used it in this state. These two pragmata can be enormously useful to the learning (and even the experienced) programmer. A word to the wise...

    And certainly do study and understand the difference between interpolating (double-quotish) and non-interpolating (single-quotish) string operators.

Re^2: Win file/dir names w/spaces
by GrandFather (Saint) on Mar 22, 2014 at 21:41 UTC

    See perlop: Quote and Quote like operators. Understanding Perl's string handling generally and the different quote types particularly is fundamental to making good use of Perl.

    If the code changes take longer than the time saved, it's fast enough already.
Re^2: Win file/dir names w/spaces
by LloydRice (Beadle) on Mar 22, 2014 at 21:28 UTC

    Thanks, Corion. I will reread perlop and study these cases some more.