in reply to Re: Pass the arguments to the procedure in an easier way
in thread Pass the arguments to the procedure in an easier way
$file2md5 =~ s/$dir\///; this is just $f.
Also, you can use another delimiter for s/// so that you don't have to escape internal characters, e.g.
s{$dir/}{}
When you escape characters in a pattern, it makes the pattern hard to read.
You also have to be aware that any characters in your dir name that are regex metacharacters, like a dot, braces, etc. need to be escaped to make perl recognize them as the literal characters rather than special regex characters. You can use quotemeta() on the string, which will escape any regex characters.
|
|---|