On Wednesday 20 August 2008 05:52, Stefan Hundhammer wrote:
On Mittwoch, 20. August 2008, Per Jessen wrote:
Can anyone epxlain to me what the 'o' modifier achieves (or not) in this example:
$copy =~ s/[[:graph:]]+//go;
...
In "simple_replace" we used the "s///g" modifier to replace all occurrences of the regexp on each line and the "s///o" modifier to compile the regexp only once. "
So it seems to be just a performance optimization.
Hence the flag character 'o'. However, it is not purely an optimization, since it has semantic differences, because it captures interpolated variable values only once, at the time it is compiled.
HTH -- Stefan Hundhammer
Randall Schulz -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org