I inherited a perl script for a website that I maintain. It pulls a delimited text file from a real estate site and inserts it into a MySQL database. There is one portion of the script that doesn't work quite right.
# Remove "Lake/River: "
if ($data =~ m!LAKE/RIVER: (\w+)!) {
$data = ucfirst(lc($1));
}
The actual data reads as "Lake/River: Rice" or "Lake/River: St. Germain". The script is supposed to reomve the text "Lake/River:" and just return "Rice" or "St. Germain". For the one-word lakes like "Rice" it works fine, but for "St. Germain" all it returns is "St.". It stops when it hits a space. Any idea on how to make it pick up both words?
# Remove "Lake/River: "
if ($data =~ m!LAKE/RIVER: (\w+)!) {
$data = ucfirst(lc($1));
}
The actual data reads as "Lake/River: Rice" or "Lake/River: St. Germain". The script is supposed to reomve the text "Lake/River:" and just return "Rice" or "St. Germain". For the one-word lakes like "Rice" it works fine, but for "St. Germain" all it returns is "St.". It stops when it hits a space. Any idea on how to make it pick up both words?