Hi all,
Is it possible to use GetOpt::Long (or something similar) in a subroutine
using @_ instead of in the standard way (using @ARGV)?
I want to have the following scenario, but use GetOpt in a subrouting within
the main script and pass options (and values) to the subroutine.
The values ($recipient, $subject, $body) must be configurable and they must
be able to take multiple values, i.e. multiple recipients for a message.
# Notify recipients via SMTP (email)
sub notify_email {
$ENV{"NTsendmail"} = $smtp;
$sender = "[EMAIL PROTECTED]";
$recipient = "[EMAIL PROTECTED]";
$subject = "ALERT";
$body = join " ", @_;
$mail = new NTsendmail;
$mail->send($sender, $recipient, $subject, $body);
}
All help appreciated! Thanks in advance.
Kind Regards,
Wim Olivier
__________________________________________________________________________________________________________________________________
Standard Bank Disclaimer and Confidentiality Note
This e-mail, its attachments and any rights attaching hereto are, unless the
context clearly indicates otherwise, the property of Standard Bank Group
Limited and/or its subsidiaries ("the Group"). It is confidential, private and
intended for the addressee only.
Should you not be the addressee and receive this e-mail by mistake, kindly
notify the sender, and delete this e-mail, immediately and do not disclose or
use same in any manner whatsoever.
Views and opinions expressed in this e-mail are those of the sender unless
clearly stated as those of the Group. The Group accepts no liability whatsoever
for any loss or damages whatsoever and howsoever incurred, or suffered,
resulting, or arising, from the use of this email or its attachments.
The Group does not warrant the integrity of this e-mail nor that it is free of
errors, viruses, interception or interference.
Licensed divisions of the Standard Bank Group are authorised financial services
providers in terms of the Financial Advisory and Intermediary Services Act, No
37 of 2002 (FAIS).
For information about the Standard Bank Group Limited visit our website
http://www.standardbank.co.za
___________________________________________________________________________________________________________________________________
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>