Page 1 of 1

Only can develop Perl on *nix systems?

Posted: Thu Mar 17, 2005 4:57 pm
by Ambush Commander
I want to start learning how to program in other languages, and I decided on perl. However, when I was downloading some perl scripts to look at, I noticed:

1. The #! lines are pointing to Linux locations for the Perl files (I have since changed my installation so it is there) and

2. Scripts make shell calls more routinely.

Does this mean that a Perl script written for Linux will not work for a Windows implementation of Perl? And if that's so, does that mean I have to get some sort of Linux system to program Perl seriously?

Posted: Thu Mar 17, 2005 5:11 pm
by feyd
kinda.. yes. You can install cygwin, which can emulate the majority of the command-line system.

Perl doesn't always need access to the shell to work though.. but for the most part, they are written for unix systems... :|

Posted: Thu Mar 17, 2005 9:48 pm
by timvw
perl scripts run on every platform that has a perl interpreter....

the #! /path/to/interpreter is called the she-bang line.. it tells your shell (*nix environment) which interpreter to use if the file is executed...

so in every environment you can start the script with: perl /path/to/script.pl. And if you want it to execute automatically (usually cgi environment) you might want to add a she-bang like #!/usr/bin/perl or #!c:/perl/perl.exe


as feyd already mentionned you can use cygwin or the gnu win32 ports to get the tools that make *nix powerful

Posted: Thu Mar 17, 2005 10:59 pm
by infolock
along with what they said above, keep in mind that perl is like a batch scripting language (just like batch it is in windows). meaning that perl scripts are mainly just console/administration applications that help you control how your system/server behaves. don't get me wrong, you can do a lot more with it, but that is what it's mainly for (and yeah, mainly on *nix systems).

Posted: Wed Mar 30, 2005 12:23 am
by Pyrite
you can use perl on windows just fine! I even have a friend who's job is writting perl windows applications. check out activestate.

http://www.activestate.com/Products/ActivePerl/

Posted: Wed Mar 30, 2005 3:20 am
by timvw
i've been using perl on windows since 2000 or something, so that part is working ;)

but what we were trying to say is that if you call other programs like fg, bg, jobs, tar, .. in your script you might run into problems because they are (at least were) not always available for windows.

Posted: Wed Mar 30, 2005 2:53 pm
by Ambush Commander
but what we were trying to say is that if you call other programs like fg, bg, jobs, tar, .. in your script you might run into problems because they are (at least were) not always available for windows.
Yeah. I guess you technically *can* develop Perl on Windows, but you'll run into some roadblocks concerning external application hooks.

Posted: Thu Mar 31, 2005 5:35 pm
by Pyrite
You can get 99% of those utils that have been ported to windows now a days though.