in reply to grep for windows
My question is what this line is doing:
$file =~ s,/,\\,g;
It is replacing / characters with \ characters in $file. The g causes the replacement to apply to all occurrences.
Commas were used as the delimiters to avoid escaping the / character. An equivalent statement would be:
$file =~ s/\//\\/g;Which many people find harder to read.
|
|---|