|Subject:||read_file very slow in Strawberry when $& is used|
As far as I can see, this only happens on win32 with strawberry perl (but not cygwin). Compare perl -MFile::Slurp -E"$t=read_file('file_of_20MB'); say length $t; $&" to perl -MFile::Slurp -E"$t=read_file('file_of_20MB'); say length $t" On my system the first line takes about 20s to finish, the second line takes less than 1s. No penalty for using $& seems to occur when binmode=>':raw' is used. This may be unavoidable and the general penalty for using $& is mentioned in perlre, but I wouldn't expect regex matters to influence File::Slurp so heavily. Minimum solution would be a warning in the pod.