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 John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Perl Capability Questions (Beginner)

Status
Not open for further replies.

JNameNotTaken

Programmer
Aug 29, 2006
24
IE
Hi All

Sorry if these questions are irritating but I've checked FAQs and googled for ages, I just have some basic questions before I launch into learning Perl.

1. Can a Perl CGI program be used to silently send an email. E.g. a user fills in a HTML form, can the resultant data be posted to an email address?
1.1 If so, is it dependent on Server capabilities and installments or can the perl interpretor deal with it itself?

2. Does a Perl CGI script compile to a binary or class file or is the actual script itself interpreted.
2.1 Is using chmod on the server sufficient to prevent users from downloading the script to see how things are done?

3. Can Perl be used in it's default state to implement the DES encryption algorithm or are some extra librarys required?

4. This one is a bit effy but, I'm running MS windows 98 (by choice, long story) does anybody know a free 'personal server' that could be used for development purposes? I downloaded Apache 2.2.3 but it actually wouldn't even install on my PC. MS Personal Server that comes with the Win98 CD is not an option either as that CD has long since disappeared.

Thanks Very Much
John
 
Not sure what you mean exactly by "silently", but Perl can send emails, yes. The best way to do it is to grab one of the mailer modules from CPAN. One of the biggest reasons to use Perl is the availability of high-quality free code on CPAN that saves you having to spend time re-writing things that others have done before.

In general, Perl scripts are interpreted and aren't compiled to bytecode or binary. There are exceptions, though. mod_perl keeps a pre-compiled version of the script in memory, to prevent it having to be recompiled each time, thus making overall execution much faster.

If your server is set up correctly, Perl scripts should be executed when they're called, so it's their output that the user will see, not the source code.

There's plenty of code for various kinds of encryption on CPAN.

I believe the 1.3 branch of apache runs on Windows 98.
 
Excellent guys, thanks very much for your help.

@ishnid : - By 'silently' I mean for a script to send a mail by itself from the server, the user will be unaware of the e-mail being sent (unless a line of html produced after the mail has been sent is written to the screen to tell him/her for convienence).
This is as apposed to having the users default e-mail tool opened for them, leaving them to send the mail. Just like mailto: in HTML.

I am assuming from your response that the former is actually what is done. Is this a correct assumption?

Thanks Again.
 
Yeah that's a correct assumption, just change your form tag to have an action of the CGI script:

Code:
<form action="handler-script.cgi" method="post">

(don't use the enctype="text/plain", it's better for CGI scripts to have things just url-encoded)

And then the script itself would run e-mail sending codes to send the e-mail and it would all be "silent" :)
 
Kirsle

Thanks for the tip. I managed to get a simple script to send mails from a html form working. I've implemented your tip.


By the way TonyGroves if you happen to read this, thanks for letting me know about Abyss. It's unreal how good it is for a program which if fairly light-weight and free. It's a great help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top