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.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|