"my" variable $folderPath masks earlier declaration in same scope at C:\gash.pl line 17. "my" variable $folderPath masks earlier declaration in same scope at C:\gash.pl line 19. Unmatched right square bracket at C:\gash.pl line 14, at end of line syntax error at C:\gash.pl line 14, near "]" syntax error at C:\gash.pl line 68, near "print" Execution of C:\gash.pl aborted due to compilation errors. #### my %findReplaceH = ( q[\\s*] =>q[
    ], q[\\s*]=>q[
], q[\\s*] =>q[
  • ], q[\\s*]=>q[
  • ], ); my $useRegexQ = 1; my $wholeFileString=' sometext '; my $replaceCount = 0; foreach my $key1 (keys %findReplaceH) { my $pattern = ($useRegexQ ? $key1 : quotemeta($key1)); $replaceCount = $replaceCount + ($wholeFileString =~ s/$pattern/$findReplaceH{$key1}/g); }; print "$wholeFileString\n"; ##
    ##