As with any 'portable' language, not all programs can be just copied between *nix and Windows. Many can, some can with effort, and others can't.
It is particularly difficult if the program has implemented functionality that relies on platform specific libraries for instance, or attempts to do things on an OS where the capabilities don't exist or work reliably ($SIG{ALRM} comes to mind).
Again though, the vast majority of the time, if a Perl script can't be migrated from one platform to another, neither can a similarly-written program written in another language.
Here's an example Makefile.PL of a Perl distribution that is specifically designed to work cross-platform. That file, and the entire codebase of the dist checks to see what OS its on, and sets itself up accordingly. In this case, the code had to be written in this fashion as it requires a lot of OS-specifics. Most of my other distributions are cross platform without any need to do any specific checking at all.
|