Larsen, Errin M HMMA/IT wrote: > Hi Perl folks, > > Is there a way to use the Getopts modules to accept more than one > instance of a single option? Here is an example command line that I > would like to see: > > # mailfiles -f filename1 -f filename2 [EMAIL PROTECTED] > [EMAIL PROTECTED] > > I'm writing a script to send an email (using Mail::Sender) to all > the addresses on the command line. After the script pulls the > addresses, it takes the final filename on the command line (or STDIN, > if no filename > listed) and sends that as the message body. I want to be able to add > an attached file or files. Any suggestions. I could send my code > here, if you'd like, but I really just need to know if I can use an > option (like the above -f) more than once on the same command line. > > --Errin
Hello again, everyone. I think I found it. It looks like I can specify an '@' at the end of an option in Getopts::Long to get an array of all the values entered multiple times. Cool. Sorry to bother the list. Next time I'll read more before I mail! --Errin -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>