http://qs1969.pair.com?node_id=11144179


in reply to In my perl script one of the variable it is giving an extra dot.

A dot has a special meaning in regexes, it matches any character except newline. To match a literal dot, you need to backslash it.

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{^\.}{};

map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]