in reply to In my perl script one of the variable it is giving an extra dot.
Moreover, you probably don't want to remove a dot from somewhere further inside the string, only the starting one. You can add ^ to the regex, it only matches at the beginning of the string.
The final g means "global", it will remove all the occurrences of the pattern. As we only want to remove a single occurrence, we don't need it.
$file =~ s{^\.}{};
|
|---|