s/\b(?!(?:if|then|else)\b)(\w+)/\$self->\{$1\}\{val\}/g #### my %stopwords = map {$_ => qr/\B/} qw(if then else); s/\b(\w+)\b(??{ $stopwords{$^N} or qr[] })/\$self->\{$1\}\{val\}/g #### @/=map{[/./g]}qw/.h_nJ Xapou cets krht ele_ r_ra/; map{y/X_/\n /;print}map{pop@$_}@/for@/