in reply to While loop and LAST
To avoid the each iterator issue that BrowserUk mentioned, use keys in a for loop instead (replacing the first six lines of your while loop with these):
for $key ( keys %job_categories ) { print ( "looking in $job_title for\: $key \n"); if ($job_title =~ /$key/i) { $department = $job_categories{$key}; print ( "found a match. setting department to $job_catego +ries{$key} \n");
Hope this helps!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: While loop and LAST
by BrowserUk (Patriarch) on Nov 02, 2013 at 07:07 UTC | |
by Kenosis (Priest) on Nov 02, 2013 at 07:25 UTC | |
by mcoblentz (Scribe) on Nov 02, 2013 at 16:29 UTC | |
by BrowserUk (Patriarch) on Nov 02, 2013 at 17:08 UTC | |
by mcoblentz (Scribe) on Nov 02, 2013 at 18:39 UTC |