in reply to Bizarreness in ?PATTERN? and g
From perlop:
?PATTERN? This is just like the /pattern/ search, except that it matches only once between calls to the reset() operator. This is a useful optimization when you want to see only the first occurrence of something in each file of a set of files, for instance. Only ?? patterns local to the current package are reset. while (<>) { if (?^$?) { # blank line between header and body } } continue { reset if eof; # clear ?? status for next file } This usage is vaguely deprecated, which means it just might possibly be removed in some distant future version of Perl, perhaps somewhere around the year 2168.
The solution? Use a different delimiter, but I'm sure you already know that ;)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Bizarreness in ?PATTERN? and g
by BUU (Prior) on Jun 04, 2004 at 05:06 UTC | |
by Mr. Muskrat (Canon) on Jun 04, 2004 at 05:09 UTC | |
by BUU (Prior) on Jun 04, 2004 at 05:16 UTC | |
by Mr. Muskrat (Canon) on Jun 04, 2004 at 05:24 UTC | |
by halley (Prior) on Jun 04, 2004 at 13:17 UTC |