Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Where can I dload a Perl Interpreter? 2

Status
Not open for further replies.

raevans

Programmer
Dec 3, 2002
28
US
Hello. I am totally new to PERL and a beginner programmer. I am sorry if this is a simple question... I have read the archives and learned a lot but I have just a couple conceptual questions...I will be grateful for anyones input, time and advice. Thanks!

First... is a Perl Interpreter free?
2) Are there different versions needed for Solaris vs Win 2K Server?
3)Does it work similar to the Java Interpreter...
4) Where does it need to be installed and how large is it?
5) Does it interface well with major OS's?

and Finally... I have a script from NMS... Which I need PERL 5.0 or greater to utilize.... Now.. unles I am mistaken... All I have to do is create the HTML form with the appropriate inputs... copy and paste the formmail.pl script into my cgi-bin.... and viola. Magic???

To clear things up... I was given...errrr...ok volunteered for this assignment at my school and now I'm stressing a litle. I wanted to test it on my laptop at home which has win 2k.... So... any advice recomendations or other will be appreciated. Please respond here or if you like the_burren@yahoo.com
Thanks again

Cor
 
1. Yes
2. Yes
3. No
4. You install it where you want to install it. I'm not sure how big it is though.
5. Any *nix like OS "should" have it.
6. If you downloaded a script, you'd have to setup your webserver to handle it (if not already done) and then place it where it belongs (usually cgi-bin). //Daniel
 
Thanks Daniel. One question when you say that any You nix type OS should have it... what about Win 2K??? Also while youre here... its NOT at all like Java???
 
Sorry.... one more question.... WHERE can I dload the most updated version of the interpreter??? any links any 1? THANKS
 
For Windows like operating systems, you have to download ActivePerl (And Perl is not like Java in any way except for the same assignment operator, basic arithmetic operators and so on. But that's as close as it gets. //Daniel
 
Thanks for the link Daniel. Do you have a link for linux based perl also? Many thanks
 
Thanks daniel I went to activeperl like you reccomended and I didnt see any downloads that were free. Everything was for sale. In addition, there was a million different things
PerlApp - Turn your Perl programs into standalone executables
PerlCtrl - Create ActiveX controls written in Perl
PerlMSI - Use Perl programs to create Microsoft MSI installation files
PerlNET - Build .NET components with Perl
PerlSvc - Convert your Perl programs into Windows services IMPROVED!
PerlTray – Run Perl applications from the Windows System Tray NEW!
Visual Debugger - Easily debug Perl scripts
Visual Package Manager - Easily install, update and remove Perl modules NEW VERSION!
SO... any further advice?
 
Perl is free from activestate.com
On there is a section in the lower right hand corner of the page titled 'downloads' with a link under the 'activeperl' sub-title. That link will ask you for a little info, but the subsequent download is free. So far, in my experience, activestate has been very conservative with the use of the 'registration' info.... a few emails about available updates.

I agree with Daniel that activestate is the way to go for any Win OS. And that CPAN is the way to go for any *nix OS.

You can get binaries for popular OSes here -
If you need to build from source, you can get the source here - 'hope this helps

If you are new to Tek-Tips, please use descriptive titles, check the FAQs, and beware the evil typo.
 
Hello go boating Thats a lot for all the info. OK.. I am set to work... but I have one question about Bin files. I know that this is probably very very basic and simple but I cant seem to get a grip conceptually on when and why bin files are used and how they are different? Basically... HOW does a bin file relate to just typing code???? I just dont get it I feel so stupid. So when you say You can get binaries for popular OS's here. I also saw something on PERLS site last nite which offered some old win 32 binaries which it called obsolete... but usable if needed. Are these just precompiled ??? Sorry for the basic nature of this question. Any wisdom will be appreciated. Thanks again
Corinne
 
bin files in what context? Some .bin files are CD images, some are installation files. //Daniel
 
Hey Daniel. Bin in the contecx of 1. You can get binaries for popular OS's here and also old win 32 binaries and in the context of what the binary files are as compared to building from source. Thanks
 
Building from source builds the binaries with the specifics you define and for your exact system. Precompiled binaries are created by authors with the default settings. //Daniel
 
Thanks daniel I was reading a little today about binaries,,, and my question is in noobe terms.. are binary files in this case the application in computer language... of 1's and 0's? or am i just stupid?
 
When I say binaries, I mean programs. These programs are basically executable files that only your computer understands. //Daniel
 
ok i loaded and installed the perl from activestate. it was just like loading any program however... when in the command prompt I try to change the directory from d to the perl folder and then the eg folder so that i can run the example.pl.... it wont let me change to the perl directory am i using the wrong syntax??? cd perl???

Interestingly though if i just type in perl after the d:/> it just hangs there ... any advice??
 
If you just type 'perl' at a prompt, you are starting the interpreter and it is waiting for you to tell it what to do.

Usually, you write your code in a text file and then pass that text file to the perl interpreter. For example, if you had the ubiquitous 'hello world'.
Code:
#!perl
print "Hello World\n";

Save that into a plain text file named hello.pl .
Then you can run it like,
c:>perl hello.pl -enter-

If you create a file association between the .pl files and the perl interpreter( I think the activestate installer does that) then you can simply type the name of the code. Behind the scenes, the same thing is happening. Windoze sees the .pl extension and passes the file to the perl interpreter the same way it would pass a .xls file to Excel. So, via a command line, you can ask the perl interpreter to try to run any file. You can name the above file hello.txt and run it like,
c:>perl hello.txt

OR, you can add the '-e' switch which tells it to execute a code block.
Code:
c:>perl -e 'print "hello world\n" -enter-

Problems changing directories is not a perl problem. Either the directory is on another drive or it is not named or where you think it is. 'hope this helps

If you are new to Tek-Tips, please use descriptive titles, check the FAQs, and beware the evil typo.
 
Yes I was able to get the directory issue resolved it was a sntax problem by me. I am reading the readme from the nms script for formmail now and i have a question regarding that. With the following lines:
"The system command that the script should invoke is $mailprog. This should be the full path to a program that will read a message from STDIN and determine the list of message recipients from the message header. Any switches that the proggie requires should be provided here."

What is STDIN?? Also... I am a little confused about whether the server has a "send_mail" program. If I have this correct... the formmail script will go into the cgi bin... and it will need a send mail program in order to execute. Can you elaborate a little on this? Specifically... does Win 2k not have a sendmail program? I dont think it does from what I read... But Solaris does? Solaris is the platform used at school where the website is hosted from.. but I am testing on a win2k server. Thats why I ask. Thanks in advance. I appreciate the help.
 
[red]What is STDIN??[/red]
In most situations, programs that accept input or create output have a built-in STDIN and STDOUT.
They are 'handles' on the default in/out mechanisms. In the simple 'hello world' script, the 'print' statement did not say where to print. It just said 'print'. The output went to the default built-in output mechanism, STDOUT.

Maybe this will make more sense if we look at a couple of explicit handles.

If you are going to write output to a file, you open a 'handle' to the file and print to the handle like this,

open(OPF,">new_file_name.txt");

# OPF is the new handle.
print OPF "Some text to go into the new file\n";
close OPF;


There you can see the explicit use of a file 'handle' named OPF (Out Put File). The default output handle for the print statement is the built-in STDOUT. Similarly, STDIN is the default input stream.
(technically, 'stream' may be slightly incorrectly used here, but...)

If you wanted to read from a file, you open a handle and read through the handle, like this.


open(IPF,&quot;<new_file_name.txt&quot;);
# IPF is the new handle.

# while (<I_get_input_from_this_handle>) { append it to $file_contents; }
while (<IPF>) # reading through IPF handle
{
$file_contents .= $_;
}
close IPF;



[red]Also... I am a little confused about whether the server has a &quot;send_mail&quot; program. If I have this correct... the formmail script will go into the cgi bin... and it will need a send mail program in order to execute. Can you elaborate a little on this? Specifically... does Win 2k not have a sendmail program? I dont think it does from what I read... But Solaris does? Solaris is the platform used at school where the website is hosted from.. but I am testing on a win2k server. Thats why I ask. Thanks in advance. [/red]

I don't think there is 'sendmail' for the Win OSes. There is a substitute called 'blat.exe' that can be used, although I've never played with it and don't know where to get it. I'm sure Google could find it. You could install 'blat' on your PC and write your code with that. Then, when you move the code to the Solaris box, expect to rewrite a little bit of your code to use sendmail.

Judging by your questions, you're pretty new to programming. That's fine and more power to you. However, I will not be able to answer your questions quickly enough to get you up to speed with Perl and CGI and Apache (probably what's running on the Solaris box). I'd suggest that you get a copy of two books:

First: (start with this one)
Teach Yourself Perl in 21 Days
from SAMS Publishing
(used to be about $40.00 and does a good job of presenting clear functional examples and makes no assumptions about the reader's previous knowledge.)

Second:
Programming Perl by Wall, Christiansen, & Schwartz (The latest edition)
Published by O'Reilly
This book is not really friendly to the newby and obfuscates a number of its examples.
However, once you get a little Perl under your belt, this will be a constant reference.
(Also, about $40.00 and is the Perl bible)
I have heard there is a book out there titled 'The Perl Bible' - it is blasphemy - O'Reilly has the real gospel. ;-)

I'll be happy to continue to answer questions as I can. 'hope this helps

If you are new to Tek-Tips, please use descriptive titles, check the FAQs, and beware the evil typo.
 
Go Boating.
I think thats what I should do. Thanks. I have no idea why I went to chubb institute for programming. wow that was a waste of 12000 dollars. To anyone out there... spend 5ooo and buy what you need from learnkey.com. As for all the help, many thanks. I think I will get the first book, for beginners and then get the other one later. I think what I would really like also, if you can reccomend anything, is a book on.... well... how do I say it.... the fundamentals of programming in general... ie, exactly what is going on... not necessarily in bytes and bits... but pretty close.... As for my impending project... perhaps you can help me with an error I am getting. To catch you up... I downloaded and placed in a directory nms_sendmail, which is used in the windows system, when a &quot;binary sendmail&quot; program (which I still dont really understand... ) isn't available. I then placed a generic html form with miscellaneous text fields and a submit button onto my default website in iis on the Win2K server....I also placed the FormMail.pl file in the cgi bin and ... well there I am. I cahnged the code in the following way in the formmail.pl:

SMTP
$mailprog = $^X =~ /(.+)/ or die;
$mailprog = &quot;$1 -wT c:/nms_utils/nms_sendmail -oi -t&quot;;


@referers = (192.168.1.101);


@allow_mail_to = qw(the_burren@yahoo.com the_burren@yahoo.com);
@recipients = ();
%recipient_alias = ();
@valid_ENV = qw(REMOTE_HOST REMOTE_ADDR REMOTE_USER HTTP_USER_AGENT);
$locale = '';
$date_fmt = '%A, %B %d, %Y at %H:%M:%S';
$style = '/css/nms.css';
$send_confirmation_mail = 0;
$confirmation_text = <<'END_OF_CONFIRMATION';
From: you@your.com
Subject: form submission

Thank you for your form submission.

END_OF_CONFIRMATION


And this change was made in the nms_sendmail program


my $mailhost = 'smtp.comcast.net';

The ERROR I am getting is:

CGI Error
The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:


Too late for &quot;-T&quot; option at c:\inetpub\ line 1.

So.... as you can imagine... I probably shouldn't have said I could/would do this by the 10th.... Thanks again and in advance for your help and time.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top