in reply to Regex matchin -(lala)- problem

You have to quote the () in $skip, otherwise they're parsed as part of the regexp:
$file ="-(lala)-"; $skip ="-(lala)-"; print "$skip / $file\n"; if ($file =~ /\Q$skip\E/i) { print "matched!\n"; }

See quotemeta. You could also use \ if your pattern is static, just watch out for the double quotes eating it up:

$skip = "-\(lala\)-"; # $skip is now -(lala)- compared with $skip = '-\(lala\)-'; # $skip is now -\(lala\)-

-- Dan