Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Best Way to accomplish a Task

0 views
Skip to first unread message

Andy

unread,
May 22, 2008, 11:12:08 AM5/22/08
to
Best Way to accomplish a Task

Greets

SCOPE: Convert linux perl scripts to run on a Windows box

What is the best way to accomplish this task ?

Is there a converter to download?


There are over 100 scripts that I need to migrate to work properly on
windows.

Any direction would be greatly appreciated.

-Thanks

Andrew DeFaria

unread,
May 22, 2008, 11:16:16 AM5/22/08
to
http://cygwin.com.
--
Andrew DeFaria
I was born by Cesarean section, but you really can't tell...except that when I leave my house, I always go out the window...

jl_...@hotmail.com

unread,
May 22, 2008, 11:28:46 AM5/22/08
to
On May 22, 9:12 am, Andy <Ramr...@gmail.com> wrote:
>
> SCOPE: Convert linux perl scripts to run on a Windows box
>
> What is the best way to accomplish this task ?
>
> Is there a converter to download?


No converter is needed. You do need to download Perl for Windows,
however, as a Perl interpreter is still required to run the Perl
scripts.

I would recommend installing ActiveState Perl, which you can
download for free at http://www.activestate.com/ .

There may be a few changes you'll have to make to the scripts. If
your scripts use Unix-like absolute paths (like "/tmp" you'll probably
want to change them to refer to an absolute DOS/WIndows-like path,
like this: "C:/tmp". (Note that you can still use front-slashes (as
well as back-slashes) in your pathnames. In fact, I recommend using
the Unix-like front-slashes over the DOS-like back-slashes, because if
you use back-slashes you'll have to remember to sometimes escape them
out, like this: "C:\\tmp". If you forget to escape-out the back-
slashes, what you thought was "C:\tmp" might become "C:<tab>mp", which
can be a difficult bug to track down.)

Also, if the Linux Perl scripts make system() calls to other
programs on your Linux computer, you'll have to make sure those same
programs also exist on your Windows machine (as Windows programs).
This also applies to backticks (``), as well as any program you invoke
with the open() statement.

If an executable that a Perl script needs does not exist for
Windows, then you'll have to find a similar one and edit the Perl
script to work with its differing output (or input).

I hope this helps, Andy.

-- Jean-Luc

Jürgen Exner

unread,
May 22, 2008, 11:46:57 AM5/22/08
to
[It would have been a better use of your one subject line if you had
mentioned the subject of your post there, e.g. something like
Porting Perl scripts from UNIX to Windows]

Andy <Ram...@gmail.com> wrote:


>SCOPE: Convert linux perl scripts to run on a Windows box
>What is the best way to accomplish this task ?
>
>Is there a converter to download?

There is no converter needed and if the original author followed the
advise in 'perldoc perlport' then they should run pretty much out of the
box on any platform.
If he didn't then 'perldoc perlport' is a great information source for
what issues to look out for and how to re-code those pieces that were
originally coded in a platform-specific way.

jue

Sherman Pendley

unread,
May 22, 2008, 1:25:36 PM5/22/08
to
Andy <Ram...@gmail.com> writes:

> SCOPE: Convert linux perl scripts to run on a Windows box
>
> What is the best way to accomplish this task ?

A good place to start is "perldoc perlport". Depending on how you've written
your code, there may even be no conversion needed at all.

sherm--

--
My blog: http://shermspace.blogspot.com
Cocoa programming in Perl: http://camelbones.sourceforge.net

0 new messages