global has asked for the wisdom of the Perl Monks concerning the following question:
I'm using MIME::Lite to send out an email. I have an ini file that I am reading some values in from. My main problem is that I want to express the From value of the email client as:
"Test User" <test@test.com> using my $msg=MIME::Lite->new(<br> 'From' =>'"Test User" <test@test.com>', etc
works but I have an ini file which I am accessing through
Local::Ini my $ini=new Local::Ini(q|test.ini|); my %defaults=$ini->defaults(); and then need to have my $msg=MIME::Lite->new(<br> 'From' =>'$defaults{Mail}{From}||"$ENV{USER}"',
but of course the single quotes stop the expansion. I have had a look at the FAQ on expanding variables in strings and expanding function calls in a string but I wasn't really sure what to do.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Variables and Strings
by dragonchild (Archbishop) on Jul 23, 2003 at 14:26 UTC | |
by global (Novice) on Jul 23, 2003 at 14:45 UTC | |
|
Re: Variables and Strings
by global (Novice) on Jul 23, 2003 at 14:25 UTC | |
|
Re: Variables and Strings
by edoc (Chaplain) on Jul 23, 2003 at 14:25 UTC | |
|
Re: Variables and Strings
by zby (Vicar) on Jul 23, 2003 at 14:30 UTC |