CC: | David Golden <dagolden [...] cpan.org> |
Subject: | [PATCH] Show in_brackets() in synopsis and docs |
Date: | Tue, 13 Jul 2010 21:33:04 -0400 |
To: | bug-Email-MessageID [...] rt.cpan.org |
From: | David Golden <dagolden [...] cpan.org> |
---
lib/Email/MessageID.pm | 15 ++++++++++-----
1 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/lib/Email/MessageID.pm b/lib/Email/MessageID.pm
index 76c2993..25e0053 100644
--- a/lib/Email/MessageID.pm
+++ b/lib/Email/MessageID.pm
@@ -13,7 +13,7 @@ Email::MessageID - Generate world unique message-ids.
use Email::MessageID;
- my $mid = Email::MessageID->new;
+ my $mid = Email::MessageID->new->in_brackets;
print "Message-ID: $mid\x0A\x0D";
@@ -104,15 +104,20 @@ sub create_user {
=head2 in_brackets
-The Message-Id header must start and end with angle brackets. This is a common
-mistake:
+When using Email::MessageID directly to populate the C<Message-ID> field,
+be sure to use C<in_brackets> to get the string inside angle brackets:
header => [
...
- 'Message-Id' => Email::MessageID->new->as_string,
+ 'Message-Id' => Email::MessageID->new->in_brackets,
],
-Instead, use C<in_brackets> to get the string inside angle brackets.
+Don't make this common mistake:
+
+ header => [
+ ...
+ 'Message-Id' => Email::MessageID->new->as_string, # WRONG!
+ ],
=cut
--
1.7.0.4