I program in C mainly. Recently I have revisiting perllooking at other people's scripts and was starting to notice how common it is to have many (10 or so) of the
$acertainvariable =~ s/regex/replacement/g;
idiom all following each other in the code. The $acertainvariable doesn't change.
is there a performance issue here? I mean, shouldn't an if or switch(or perl equivalent) statement be used? The number of match attempt can clearly be reduced that way.
Now many of these are simple utility scripts, so it mightn't matter ... dunno, it just struck me.
Thank you JavaFan, roboticus and cdarke for your replies. I'm clear about ~= now