This seems like an easy thing, but it's driving me bonkers. I've been working on a photo gallery app for Catalyst. One of the 'features' I discovered last night was that when I uploaded a file on Windows to the Unix server, file($file)->basename was giving me the whole file name, not just the base name for the windows files.
Given the power of Path::Class and File::Spec, I thought surely there was a better way. But I haven't found it yet.
There is foreign_file and as_foreign, even new_foreign. They all assume that I know the source file system. When uploading files over the web, I don't.
Now sure, I could do some hackery pokery to sniff the user-agent, or sniff the filename for / or \ or : or
Maybe there should be a from_foreign() that does the sniffing magic and converts the output to the native fs on which it's running?