Shouldn't be much of a change. The only somewhat tricky part might be a fancier use of split in order to avoid having to concatenate the first few values together after splitting them previously. I think this should work:
# Instead of the existing split in the code I wrote...
my ($pre, $possible) = split / ([^ ]+)$/, $stu;
That way, you can just concatenate $pre to the beginning of $matched_dp when you assign to $stu.
As a sidenote, am I the only one that was surprised to find that Perl does not have an rsplit function? This is possibly the first time I've found myself thinking 'Gee, if this were Python...' :P
-
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.
|