Specifically, I am talking about the code pasted below. The perlop entry talks about qr() in the same breath as q(),qq(),qx(),etc and Programming Perl has this to say about them -
"Some of these are simply forms of "syntactic sugar" to let you avoid putting too many backslashes into quoted strings. Any non-alphanumeric, non-whitespace delimiter can be used in place of /. If the delimiters are single quotes, no variable interpolation is done on the pattern. If the opening delimiter is a parenthesis, bracket, brace, or angle bracket, the closing delimiter will be the matching construct."
Am I missing something here ?
use strict; use diagnostics; use Getopt::Long; my ( $timing ) = 0 ; my $regexp = qr(\s+execution\s+time\s+\(\s+millis\s+\)\s+\:\s+); while(<DATA>) { chomp; do { ( $timing ) = /$regexp(\d+)/; print "$timing "; }if /$regexp/; } print "Done!\n"; __DATA__ PPP execution time ( millis ) : 1062 PPP execution time ( millis ) : 6460 PPP execution time ( millis ) : 7570 PPP execution time ( millis ) : 38646 PPP execution time ( millis ) : 45658 PPP execution time ( millis ) : 577
In reply to qr delimiter question by nr0mx
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |