The regex should say what you want to match, you don't do that so after the /P/ gets substituted the T fires on 'T'unnel. instead of the T after the P. Try:
$_[0] =~ s/43 F/Tunnel 1\/2 Hr FT/o; $_[0] =~ s/43 P/Tunnel 1\/2 Hr PT/o; $_[0] =~ s/45 F/Tunnel No Lunch FT/o; $_[0] =~ s/45 P/Tunnel No Lunch PT/o; $_[0] =~ s/F(.$)/Full Time No Clock $1/o; $_[0] =~ s/O(.$)/On Call No Clock $1/o; $_[0] =~ s/P(.$)/Part Time No Clock $1/o; $_[0] =~ s/T$/Temporary No Clock/o;
I don't know whether O is the first or second of the two character code you are substituting, I guessed it was the first char. Anyhow, it you tell it to substitute T at the end of the string, you get what you want.
Hope this gets you closer to your goal.
In reply to Re: Regex Substitution in sub
by pzbagel
in thread Regex Substitution in sub
by peppiv
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |