Hi,
I have a list of mp3 files in my computer and some of the file names consists 
of  a bracket like this "darling I love [you.mp3"
I wish to check them for duplicates using the script below, but theres error 
msg like this "Unmatched [ in regex; marked by <-- HERE in m/only one brace 
here[ <-- HERE anything.mp3/ at Untitled1 line 13."
 
So how do I rewrite the regexp.
Thanks.
 
###### script ###
#!/usr/bin/perl
use strict;
use warnings;
use File::Find;
 
my @datas = ("test.mp3" , "only one brace here[anything.mp3" , "whatever.mp3");

while (@datas){
      my $ref = splice @datas,0,1;
      foreach (@datas){
          if ($ref =~/$_/){
             print "$ref is a duplicate\n";
          }else{
             print "$ref is not a duplicate\n";
          }
      }
}

Reply via email to