in reply to Re^3: More efficient way to truncate long strings of the same character
in thread More efficient way to truncate long strings of the same character

So when I run:

use strict; use warnings; my ($ikegamiRe1) = map qr/$_/, join '|', map "(?<=$_{3})$_+", map quot +emeta, 1 .. 9;

I should ignore:

Use of uninitialized value in concatenation (.) or string at noname.pl + line 4. Use of uninitialized value in concatenation (.) or string at noname.pl + line 4. Use of uninitialized value in concatenation (.) or string at noname.pl + line 4. Use of uninitialized value in concatenation (.) or string at noname.pl + line 4. Use of uninitialized value in concatenation (.) or string at noname.pl + line 4. Use of uninitialized value in concatenation (.) or string at noname.pl + line 4. Use of uninitialized value in concatenation (.) or string at noname.pl + line 4. Use of uninitialized value in concatenation (.) or string at noname.pl + line 4. Use of uninitialized value in concatenation (.) or string at noname.pl + line 4.

Update: Oh, and here's an interesting result:

use strict; #use warnings; my $str = join '|', map "(?<=${_}{3})$_+", 1 .. 2; print $str, "\n"; $str = join '|', map "(?<=$_{3})$_+", 1 .. 2; print $str;

Prints:

(?<=1{3})1+|(?<=2{3})2+ (?<=)1+|(?<=)2+

Perl reduces RSI - it saves typing

Replies are listed 'Best First'.
Re^5: More efficient way to truncate long strings of the same character
by ikegami (Patriarch) on Oct 31, 2008 at 00:05 UTC
    Oh shoot, that's a string literal and not a regexp literal! Fixed.