For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > August 2007 > Cygwin like Module in perl









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Cygwin like Module in perl
Perl Pra

2007-08-04, 7:58 am

Hi Gurus,


I want to execute some of the unix commands on windows, Presently we are
using Cygwin to run unix commands on Windows.

Now I need to convert all the shell scripts into perl scritp. Is there any
module in perl which allows me to execute unix commands on Windows.

My windows version Windows 2003 EE.

Thanks in Advance.
PS.

Ken Foskey

2007-08-04, 7:01 pm

On Sat, 2007-08-04 at 16:54 +0530, perl pra wrote:
> Hi Gurus,
>
>
> I want to execute some of the unix commands on windows, Presently we are
> using Cygwin to run unix commands on Windows.
>
> Now I need to convert all the shell scripts into perl scritp. Is there any
> module in perl which allows me to execute unix commands on Windows.


Cygwin virtually is Unix (yes there are differences, look up cygpath for
example Nd only use forward slashes in directories). I run tests on
programs destined for Unix on windows all the time, just write the code
the same and you will learn the very small differences.


--
Ken Foskey
FOSS developer

Chas Owens

2007-08-04, 7:01 pm

On 8/4/07, perl pra <perlpra@gmail.com> wrote:
> Hi Gurus,
>
>
> I want to execute some of the unix commands on windows, Presently we are
> using Cygwin to run unix commands on Windows.
>
> Now I need to convert all the shell scripts into perl scritp. Is there any
> module in perl which allows me to execute unix commands on Windows.

snip

Perl is a general purpose language like C (which is what the unix
utilities are written in), so, in general, you shouldn't be running
unix commands. For instance, instead of saying
system("rm -f $file");
you should say
unlink($file);

If you have questions about what the Perl way of doing what specific
unix utilities do then feel free to ask.
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com