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!
In reply to Re: While loop and LAST
by Kenosis
in thread While loop and LAST
by mcoblentz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |