I am tryig to substitute several things in a file going line by line. I was wondering if there is any way I can add a stop condition to to the substitution operator "s/PATERN/REPACMENT/g", because I do not want it to replace anything on the line after a ";" is reached. Basicly I'm writing a script to replace strings in a ASM file and I want it to ignore anything after the comment char ";".
I was just wondering if there is an easyer way rather than do this:
if(m/;/)
{$comntpos = pos(':')}
then checking every substitution if it happens after $comntpos.
if so ignore if not do the substitution.
Also as a side note if I wanted to set a $Var equal to a semicolen (i.e. $Var = ';' is this how I do it??
I was just wondering if there is an easyer way rather than do this:
if(m/;/)
{$comntpos = pos(':')}
then checking every substitution if it happens after $comntpos.
if so ignore if not do the substitution.
Also as a side note if I wanted to set a $Var equal to a semicolen (i.e. $Var = ';' is this how I do it??