in reply to s// doesn't work when second loop!

That's because after the replacement, the pattern no longer matches the string.
#! /usr/bin/perl use warnings; use strict; my $input = 'a'; my $doesnt_work = $input; for (1 .. 10) { my $works = $input; $works =~ s/a/$_/; $doesnt_work =~ s/a/$_/; print "Works: $works\n", "Doesn't work: $doesnt_work\n"; }
($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,