in reply to Re: backtick iterpolation issue
in thread backtick iterpolation issue

 $VAR1 = "\\/Volumes\\/public_files\\/music\\/The\\ Lexicon\\ Of\\ Love\\/4\\.Tears\\ Are\\ Not\\ Enough\\.mp3\\\r"; playlist row is just a line pulled from an itunes m3u file, though I filtered out the comments from the m3u file:
open(my $fh2, '<:encoding(UTF-8)',$playlistName) or die "Could not open playlist file '$playlistName $! +"; while( my $playListRow = <$fh2>){ chomp $playListRow; if($playListRow =~ /^\s*#/){ next;} else{ # print "$playListRow\n"; $playListRow = quotemeta($playListRow); my $lscom = "ls $playListRow 2>&1";

Replies are listed 'Best First'.
Re^3: backtick iterpolation issue
by choroba (Cardinal) on Jul 01, 2015 at 13:49 UTC
    Replace chomp with
    $playListRow =~ tr/\xd\xa//d;

    It should remove all the newlines, CR/LF or LF style.
    Update: You might need to verify how file names containing newlines are represented in the list.

    لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ