http://qs1969.pair.com?node_id=56775


in reply to Infinite Recursion of a String
in thread Double Interpolation of a String

It might be useful to protect against infinite recursion as well:
my $max_recurs = 10; $max_recurs-- while $string =~ ... && $max_recurs; warn "Too many recursive substitutions on '$string'" if !$max_recurs && $^W;