When would you use qr// on a literal string?



I thought that qr was mainly used for pre-compiling variables into
regex patterns, but a colleague uses it like so:

my ( $name, $value ) = split qr/=/, $string;

Are there any benefits to doing this? He claims that the use of the
qr// op here can help capture an error if the STRING is not a valid
regex. Does this make any sense?

.



Relevant Pages