> Hi Perl Mongers,
So in this case you have two arguments in ARGV and waiting text on
STDIN? Is it this last part that is confusing you.
Ok an easy one nothing in ARGV.
Ok so in this case ls.out as you point out won't have an character, so
we can assume that it is a file to read. So the question becomes, does
this have to be the last argument, can there be multiple files, is it an
error if an argument doesn't look like an email AND isn't a file? These
are design issues, but all can be worked around depending on the answers.
Well you can start to match email addresses. It is better to match them
with Email::Valid once you have what you think is an address.
What have you tried? Where did you fail? You know better than to post
without code :-).
Again, what have you tried?
So it goes something like, check for arguments, check that the arguments
look like email addresses, if not then maybe it is a file, check to see
if it exists (throw warning/error), if so then push it to a list and go
to the next one. If it is a file you could push it to a different list.
Then check STDIN for input, store it to an array for your message. Then
check your list of files, import them into the content list (or even
better maybe you want to attach them!!). If something is missing throw
an error or set some defaults, if not send the message. Take it a chunk
at a time, run it hundreds of times with lots of print statements until
you have what you want.
Consider the AppConfig module too, it has some more capability that
might come in handy this time.
Don't give up, never admit defeat....