Subject: | allow scalar "string" arg to new |
If you have a string, it's a little annoying to have to split it when
passing it as an arg to Mail::Internet->new. This patch makes it
possible to pass in a scalar reference, which will be treated as a
string to split on newlines.
--
rjbs
Subject: | scalarref.patch |
diff -Nur MailTools-1.74/Mail/Internet.pm MailTools-rjbs/Mail/Internet.pm
--- MailTools-1.74/Mail/Internet.pm 2006-01-21 04:16:10.000000000 -0500
+++ MailTools-rjbs/Mail/Internet.pm 2006-11-17 20:38:48.000000000 -0500
@@ -61,6 +61,10 @@
if(defined $arg)
{
+ if(ref($arg) eq 'SCALAR')
+ {
+ $arg = [ split /\n/, $arg ];
+ }
if(ref($arg) eq 'ARRAY')
{
$me->header($arg) unless exists $arg{Header};