in reply to passing a hash to module function

Your problem lies in the fact that you're calling sendmail as a method.
$mail->sendmail({to=>'koszta@seznam.cz', from=>'admin@server.com', dat +a=>'hi from server', + subject=>'msg body'});
Either, call it as a function if that is what's appropriate
sendmail({to=>'koszta@seznam.cz', from=>'admin@server.com', data=>'hi +from server', + subject=>'msg body'});
Or remember to pull the object reference first.
sub sendmail { my $self = shift; my $param = shift;

Replies are listed 'Best First'.
Re^2: passing a hash to module function
by kosta (Sexton) on Feb 15, 2011 at 20:00 UTC
    Thank you, I am just getting my way around in perl (comming over from php is tough but definitelly worth it)... I love CPAN it has anything... But I get stuck at issues like this. Well I am gonna learn it!