There's a couple of problems that sound get you started. The first I
see is that @_ is an array containing everything that was passed in. So
when you did
@parms = @_;
The values of each element of @parms are as follows
$parms[0] # first parameter which was $email
$parms[1] # second parameter which was ''
$parms[2] # third parameter which was ''
Second is that you're calling 'split' on $parms. What is $parms? I
don't see it declared or used anywhere prior to the split.
I think you're looking to do something more like this
sub send_mail {
my( $user, $user_list, $tag ) = @_;
instead of assigning to @parms and doing split.
Please use -w and 'use strict'. It will tell you much more about your
script and help you debug scripts. There is also a 'use diagnostics'
that will help out.
Hope this helps.
Dan
[EMAIL PROTECTED] wrote:
>
> Hi,
>
> I have this small problem of being able to pass routines.
>
> send_mail( $email, '','');
>
> sub send_mail {
>
> $msg = new Mail::Send;
>
> @parms = @_;
> ($user, $user_list, $tag) = split /,/, $parms;
>
> $msg->to($user);
> print "User is $user\n";
> $ans = <STDIN>;
> $msg->subject('Password Notification');
> $msg->cc($user_list);
> # $msg->bcc('someone@else');
>
> # Launch mailer and set headers. The filehandle returned
> # by open() is an instance of the Mail::Mailer class.
>
> ($user, $user_list, $tag) = split /,/, $parms;
>
> $msg->to($user);
> print "User is $user\n";
> $ans = <STDIN>;
> $msg->subject('Password Notification');
> $msg->cc($user_list);
> # $msg->bcc('someone@else');
>
> # Launch mailer and set headers. The filehandle returned
> # by open() is an instance of the Mail::Mailer class.
>
> $fhm = $msg->open;
>
> print $fhm "This is a notification of password reset. \
> You must change your password Immediately \
> Your temporary Password is your UID + EMPLOYEE ID .
> ";
>
> $fhm->close;
> }
>
> The intent here is to pass the users email address and send out the
> notification.
>
> What happening is that the print statement for the users is coming out
> to nothing.
> Any suggestions?