http://qs321.pair.com?node_id=180606


in reply to capturing from path

To break a path up into directory and file components, you can either split on the / character, or for a more portable solution, use File::Spec's splitpath and splitdir functions.