in reply to Re: Usig file name without backslash escape
in thread Usig file name without backslash escape

In a regex or double-quoteish string, a  \ (backslash) escaped = or , is no different than the unescaped character.

>perl -wMstrict -le "my $file = 'a=b,c=d,e'; $file =~ s/\=/\=/g; $file =~ s/\,/\,/g; print qq{unchanged: '$file'}; " unchanged: 'a=b,c=d,e'

Replies are listed 'Best First'.
Re^3: Usig file name without backslash escape
by rkrasowski (Sexton) on Jun 28, 2012 at 21:57 UTC
    I got it working that way:
    <code> #!/usr/bin/perl use strict; use warnings; my $file; opendir(DIR, "$newDir"); my @FILES= readdir(DIR); closedir DIR; foreach (@FILES) { $file = $_; if ($file ne "..") { if ($file ne ".") { my $newFile = "/home/iphone/Maildir/ne +w/$file"; my $curFile = "/home/iphone/Maildir/cu +r/$file"; rename $newFile, $curFile or die $!; } } }
    </code> Thanks for help Robert