in reply to Re^3: A silly reg exp question
in thread A silly reg exp question
++ and amen, but only with no warnings 'void'; since one cannot enjoy perversity incautiously.
In fact, wouldn't any of the left-associative operators * x + - . << >> & | ^ , => xor do as well so long as precedence levels were not mixed unwisely? Although I haven't thoroughly tested it, I like:
>perl -wMstrict -le "$_ = 'p1r4k/8'; my $t = 'p-r----k/--------'; no warnings 'void'; s/8/7-/g-+s/7/33-/g-+s/6/5-/g-+s/5/22-/g-+s/4/3-/g-+s/3/11-/g-+s/2/1- +/g-+s/1/-/g; print qq{'$_'}; print $_ eq $t; " 'p-r----k/--------' 1
|
|---|