sub Strip_Subsection { use DebPool::Config qw(:vars); my($section) = @_;
if (!defined($section)) { printf("section is not defined!\n"); return 'main'; } my($check_section); foreach $check_section (@{$Options{'sections'}}) { printf("Strip_Subsection section='%s'\n", $section); printf("Strip_Subsection check_section='%s'\n", $check_section); if ($section =~ m/$check_section\/.+/) { return $check_section; } } return 'main'; } Changed Strip_Subsection to the above and add a printf to PoolDir to see what Strip_Subsection returns. Running this code against a package the has a 'Section: contrib' here is the debug output. Strip_Subsection section='contrib' Strip_Subsection check_section='custom' Strip_Subsection section='contrib' Strip_Subsection check_section='contrib' PoolDir section=main Note, section and check_section match, but main is still returned. Running this code against a package the has a 'Section: contrib/otherosfs' here is the debug output. Strip_Subsection section='contrib/otherosfs' Strip_Subsection check_section='custom' Strip_Subsection section='contrib/otherosfs' Strip_Subsection check_section='contrib' PoolDir section=contrib I think the problem is the match code if ($section =~ m/$check_section\/.+/) { That regex looks like it is requiring a / followed by 1 or more of anything, I believe the / should be option? -- Bob Tanner <[EMAIL PROTECTED]> | Phone : (952)943-8700 http://www.real-time.com, Minnesota, Linux | Fax : (952)943-8500 Key fingerprint = AB15 0BDF BCDE 4369 5B42 1973 7CF1 A709 2CC1 B288 -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]