Skip to content

Instantly share code, notes, and snippets.

@kaz-utashiro
Created April 26, 2014 08:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kaz-utashiro/11314743 to your computer and use it in GitHub Desktop.
Save kaz-utashiro/11314743 to your computer and use it in GitHub Desktop.
Perl の @- と @+ のペナルティが高すぎる ref: http://qiita.com/kaz-utashiro/items/2facc87ea9ba25e81cd9
while (/pattern/g) {
my($s, $e) = ($-[0], $+[0]);
...
while (/(pattern)/g) {
my($s, $e) = (pos() - length($1), pos());
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment