When would you use qr// on a literal string?
- From: "it_says_BALLS_on_your forehead" <simon.chao@xxxxxxx>
- Date: 17 Jul 2006 07:07:31 -0700
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?
.
- Follow-Ups:
- Re: When would you use qr// on a literal string?
- From: Tad McClellan
- Re: When would you use qr// on a literal string?
- From: Dr.Ruud
- Re: When would you use qr// on a literal string?
- From: A. Sinan Unur
- Re: When would you use qr// on a literal string?
- Prev by Date: Re: Net::Telnet - Library Application
- Next by Date: Re: Perl equivalent of this script?
- Previous by thread: A subroutine for gcd
- Next by thread: Re: When would you use qr// on a literal string?
- Index(es):
Relevant Pages
|
|