in reply to Re^2: File::Basename and File::MMagic for File Downloads from Website
in thread File::Basename and File::MMagic for File Downloads from Website

Sorry, it had been a while. It does behave in a system-specific fashion.

Technically, what you ask is impossible. 'foo\bar' should return 'foo\bar' if a unix path and 'bar' if a Windows path, but you don't know what kind of path your client built. That means you might as well roll out code that does what you want it to do.

my $basename = ( split /[:\/\\]/, $_ )[-1];