Only can develop Perl on *nix systems?

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

Post Reply
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Only can develop Perl on *nix systems?

Post 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?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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... :|
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post 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
User avatar
infolock
DevNet Resident
Posts: 1708
Joined: Wed Sep 25, 2002 7:47 pm

Post 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).
User avatar
Pyrite
Forum Regular
Posts: 769
Joined: Tue Sep 23, 2003 11:07 pm
Location: The Republic of Texas
Contact:

Post 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/
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post 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.
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post 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.
User avatar
Pyrite
Forum Regular
Posts: 769
Joined: Tue Sep 23, 2003 11:07 pm
Location: The Republic of Texas
Contact:

Post by Pyrite »

You can get 99% of those utils that have been ported to windows now a days though.
Post Reply