in reply to Re: Need tips on portable Perl programming
in thread Need tips on portable Perl programming

<o> Hi,

I totally agree with what you said below:

"You give the example of df, and you are right. So avoid calling external programs as far as possible. Try and use internal Perl commands, or use modules that are portable."

Now, my next question is "Is there any such Perl module or library that allows you to run one single command but somehow "clever" enough to run either the Windows command or the UNIX command?"

It's kinda like using alias command on UNIX to map the most command Windows/DOS command into its UNIX equivalent command. If such a module exists, then perhaps that may do the trick.

To illustrate it further, maybe there is a Perl module where I say clearscr and then inside the Perl module, it will run cls if the OS is Windows or clear if the OS is *nix? Am I making this node more confusing?

  • Comment on Re^2: Need tips on portable Perl programming