On 6/25/03 at 9:59 PM, [EMAIL PROTECTED] (matthew gaskill-jones)
wrote:

> All,
> 
> I am new to Perl, ...

Welcome to Perl. My first bit of advice would be - don't reinvent the
wheel. Perl already has some excellent modules for handling form input,
the most popular being the CGI module. It's as simple as:

    use CGI;
    
    my $query = new CGI;
    
    my $thingie = $query->param('form_field_name');
    
    # now you can use your $thingie

Trust me on this. Dealing with raw form data is more complex than just
splitting on '=' and '&'. See the CGI manpage for more info: perldoc CGI

My next bit of advice would be to always use 'warnings' and 'strict':
use warnings;
use strict;
Just do it.  See perldoc warnings and/or strict for more info.


>     open (MESSAGE,"| /usr/sbin/sendmail -t");
Lastly, it's a good idea to validate user data before using it outside
of your program (like in a pipe to sendmail). A malicious user can
easily cause trouble for you otherwise. Basically, just make sure that
the data is what you are expecting it to be; regular expressions can be
good for this. See perldoc perlre.

> 
> 
>     &thank_you;
ok one more...call your subroutines like this:
thank_you();
(unless you understand the implications with @_ )
see perldoc perlsub for more info.


- btw Learning Perl by Randal Schwartz is nice too :-)

Regards,
Andrew

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to