in reply to weird error when using substring function

Have you checked File::Basename or File::Spec's splitpath function? One, or both, of these, will do what you're looking for (though I'm not sure about the crash - maybe upgrading to a newer version of perl would help...)

  • Comment on Re: weird error when using substring function