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?
Only can develop Perl on *nix systems?
Moderator: General Moderators
- Ambush Commander
- DevNet Master
- Posts: 3698
- Joined: Mon Oct 25, 2004 9:29 pm
- Location: New Jersey, US
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
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
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).
- Pyrite
- Forum Regular
- Posts: 769
- Joined: Tue Sep 23, 2003 11:07 pm
- Location: The Republic of Texas
- Contact:
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/
http://www.activestate.com/Products/ActivePerl/
- Ambush Commander
- DevNet Master
- Posts: 3698
- Joined: Mon Oct 25, 2004 9:29 pm
- Location: New Jersey, US
Yeah. I guess you technically *can* develop Perl on Windows, but you'll run into some roadblocks concerning external application hooks.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.