in reply to stat on file name containing single quotes

I suspect that you're assigning $fn like this:
my $fn = "E:\Music\Ray LaMontagne\2010 - God Willin' & The Creek Don't Rise";

If that's the case and you have warnings enabled, you should be receiving a warning like this.

Unrecognized escape \M passed through at C:\test\Perl-1.pl line 9. Unrecognized escape \R passed through at C:\test\Perl-1.pl line 9.

Replies are listed 'Best First'.
Re^2: stat on file name containing single quotes
by AnomalousMonk (Archbishop) on Jul 30, 2015 at 22:15 UTC

    Not to mention octal character  \201 which is interpolated quite silently:

    c:\@Work\Perl\monks>perl -wMstrict -le "my $fn = qq{E:\Music\Ray LaMontagne\2010 - God Willin' & The Creek Do +n't Rise}; print qq{'$fn'}; " Unrecognized escape \M passed through at -e line 1. Unrecognized escape \R passed through at -e line 1. 'E:MusicRay LaMontagneü0 - God Willin' & The Creek Don't Rise'


    Give a man a fish:  <%-(-(-(-<

Re^2: stat on file name containing single quotes
by afoken (Chancellor) on Jul 31, 2015 at 09:39 UTC

    A simple workaround is to use forward slashes instead of backslashes. Windows accepts them without problems. The only place where forward slashes may become problematic is on the command line of external programs. In that case, a simple tr|/|\\| helps.

    Alexander

    --
    Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)