in reply to Quick REGEXP question

Definitely follow up with the File::Basename because it is handy. As for handling different alternative extensions in a single regex, something like this would also work:
my ( $ext ) = ( $systempath =~ m{[\\/][a-z0-9]+\.(cgi|pl|asp)$} );
The parens around $ext turn the left-hand-side into a list context, and the parens within the regex will capture any of the three alternative strings and return the capture as a list (which then gets assigned to $ext).