in reply to Re^2: inserting string only once after matching a pattern
in thread inserting string only once after matching a pattern

I actually had (!~) initially but I read on a webpage that it's better to use "ne".

When comparing against a constant strings, it's more efficient to avoid regexps.

$var eq 'abc' $var ne 'abc' $var1 eq $var2 $var1 ne $var2
are faster and simpler than
$var =~ /^abc\z/ $var !~ /^abc\z/ $var1 =~ /^\Q$var2\z/ $var1 !~ /^\Q$var2\z/

I'll study the different not equals soon.

$var ne /regexp/
means
$var ne ($_ =~ /regexp/)