Hi all,
What are the statements in a perl script that need attention/change for making the script run in a different OS.
ofcourse the perl interpreter path(hashbang line)
Say for eg: perl statements (system, exec and backtick ) involves command line commands.So commands will differ for different OS and so that needs to be changed.
what else needs change?
help out,

11 Years
Discussion Span
Last Post by MattEvans

For different versions of UNIX, usually nothing. You will have to make sure that any modules you use in your script on one system are present in the next system for them to work.

Modules will also be your biggest problem working between the Windows and UNIX platforms. Some modules are designed only for the UNIX environment. In addition to this, any system commands that you call in one will be obviously different in the other.

Beside these differences, the core language should operate identically in different environments.


some of perls native functions are also meant for Unix, such as flock() and chmod() and some functions might return a different value depending on the operating system, like stat().


should be the same if you use a correct path to the binary. some functions to access the binary will be different (won't work), but calling open $out," | *.exe" or exec(*.exe) should work the same...

I don't know whether system() works, but I imagine it does..

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.