sandy1028 has asked for the wisdom of the Perl Monks concerning the following question:

Hi, How to get the variables from php which is sent in <form action=""> I am getting error: $mail_server" requires explicit package name at a.pl line 6 Is the code wrong.
#!/usr/bin/perl use Mail::Sendmail; use strict; use warnings; $mail_server = 'xxx.xxx.xx.xx'; #$email= $_POST['email']; $mail_to = 'abc@xyz.in'; $mail_from ='xyz@bac.in'; $body="Test Mail"; $subject = 'Test Mail'; mail($mail_server, $mail_from, $mail_to, $subject, $body);

Replies are listed 'Best First'.
Re: Sending Mail
by Taulmarill (Deacon) on Aug 16, 2007 at 09:40 UTC
    When you use strict; you have to initialize all variables with the function my.
    I.e. my $mail_server = 'xxx.xxx.xx.xx';
      How to get the variables from php file to perl files... Is there any way to get the variables from php file
        Why try to pass between the two languages? Why not set up a mailing form and mail script in either Perl or PHP?
Re: Sending Mail
by Anonymous Monk on Aug 16, 2007 at 12:05 UTC