I have a subroutine that outputs words in my subject area of my mail hash and
works great but I now want to add words to the subject area without touching my
subroutine.
I was wondering how I can get some additional words with my subroutine
in the Mail "Subject" part. The Subject outputs "first word"
with no problem but I want to add additional text to the subject (without
touching my subroutine) so my output is "first word another word here".
Any experts can advise how I would do this in my mail hash??
sub mal
{
my $webname = "first word";
return $webname;
}
use Mail::Sendmail;
my %mail = ( To => 'you@hotmail.com',
From => 'me@hotmail.com',
Subject => mal(), #this gives me output in my ma
+il subject of "first word"
Message => "data here",
);
I have tried all these below (in my subject part of this hash) and all of my attempts are not working:
Subject => "mal() ,another word here",
Subject => 'mal() ,"another word here',
Subject => mal() 'another word here',
I can not get this to work after many different tries at it.
Please advise how I can get the hash part to accept additional
words along with my
mal() subroutine so it outputs in my
subject part of the email:
"first word another word here"
instead of:
"first word"
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.