Skip Menu |

This queue is for tickets about the Mail-Sender-Easy CPAN distribution.

Report information
The Basics
Id: 41213
Status: rejected
Priority: 0/
Queue: Mail-Sender-Easy

People
Owner: Nobody in particular
Requestors: edav [...] acan.com.mx
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: v0.0.5
Fixed in: (no value)



Subject: Error using Mail::Sender::Easy
Hi, I'm trying out your package but whenever I try to send email with it I get the following error: Can't call method "easy" without a package or object reference at /usr/lib/perl5/site_perl/5.8.8/Mail/Sender/Easy.pm line 32. I have Mail::Sender 0.8.16 and File::Spec 3.29 Thanks for your work on this module - Erik
Show quoted text
> Can't call method "easy" without a package or object reference at > /usr/lib/perl5/site_perl/5.8.8/Mail/Sender/Easy.pm line 32.\
Did you do it as per: http://search.cpan.org/~dmuey/Mail-Sender-Easy-v0.0.5/Easy.pm#Method:_$sender- %3Eeasy() If you are indeed doing it as per the docs, then please send the code that exhibits this error.
Subject: Re: [rt.cpan.org #41213] Error using Mail::Sender::Easy
Date: Tue, 25 Nov 2008 15:57:04 -0600
To: bug-Mail-Sender-Easy [...] rt.cpan.org
From: "Erik Álvarez Vázquez" <edav [...] acan.com.mx>
Hi, yes I'm using the example from the docs. Here is the code: use Mail::Sender::Easy qw(email); my $Host = 'mail.acan.com.mx'; my $From = 'Soporte <soporte@acan.com.mx>'; email({ 'from' => $From, 'to' => 'erik.alvarez@acan.com.mx', 'subject' => 'Perl is great!', 'priority' => 2, # 1-5 high to low 'confirm' => 'delivery, reading', 'smtp' => $Host, '_text' => 'Hello *World* :)', '_html' => 'Hello <b>World</b> ', }) or die "email() failed: $@"; thanks - Erik 2008/11/25 Daniel Muey via RT <bug-Mail-Sender-Easy@rt.cpan.org>: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=41213 > >
>> Can't call method "easy" without a package or object reference at >> /usr/lib/perl5/site_perl/5.8.8/Mail/Sender/Easy.pm line 32.\
> > Did you do it as per: > > http://search.cpan.org/~dmuey/Mail-Sender-Easy-v0.0.5/Easy.pm#Method:_$sender- > %3Eeasy() > > If you are indeed doing it as per the docs, then please send the code that exhibits this error. >
-- - Erik
On Tue Nov 25 16:57:21 2008, edav@acan.com.mx wrote: Show quoted text
> Hi, yes I'm using the example from the docs. Here is the code:
That code is the function 'email' not the method 'easy()' like your error says: " Can't call method "easy" without a package or object reference at ..." If you were really doing the code you pasted below and the function was somehow silently not imported then you'd get: "Undefined subroutine &main::email at ..." Please paste in the actual code that you are using that gives this error. (be sure to hide any private data) Show quoted text
> use Mail::Sender::Easy qw(email);
... Show quoted text
> email({
Subject: Re: [rt.cpan.org #41213] Error using Mail::Sender::Easy
Date: Tue, 25 Nov 2008 16:40:20 -0600
To: bug-Mail-Sender-Easy [...] rt.cpan.org
From: "Erik Álvarez Vázquez" <edav [...] acan.com.mx>
Hi Daniel. That is the real code, as the error obviously shows that the problem is in YOUR module(easy.pm), your module doesn't seem to work, at least in my environment, but don't worry, I used Mail::Sender directly and it worked great, thanks for the help. - Erik 2008/11/25 Daniel Muey via RT <bug-Mail-Sender-Easy@rt.cpan.org>: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=41213 > > > On Tue Nov 25 16:57:21 2008, edav@acan.com.mx wrote:
>> Hi, yes I'm using the example from the docs. Here is the code:
> > That code is the function 'email' not the method 'easy()' like your error says: > > " Can't call method "easy" without a package or object reference at ..." > > If you were really doing the code you pasted below and the function was somehow silently > not imported then you'd get: > > "Undefined subroutine &main::email at ..." > > Please paste in the actual code that you are using that gives this error. (be sure to hide any > private data) >
>> use Mail::Sender::Easy qw(email);
> ...
>> email({
> > > > >
-- - Erik
On Tue Nov 25 17:40:37 2008, edav@acan.com.mx wrote: Show quoted text
> Hi Daniel.
Hello Erik, Show quoted text
> That is the real code, as the error obviously shows that the problem > is in YOUR module(easy.pm), your module doesn't seem to work, at least > in my environment,
There is no need to get upset, I'm mearly asking for clarification. Your initial report is vague, there no information about how you got the error, the versions of any modules involved, etc. (IE your "environment" as you put it above) Perhaps this will help in the future: http://www.catb.org/~esr/faqs/smart-questions.html http://www.sindominio.net/ayuda/preguntas-inteligentes.html Back to the problem: The code sample you sent works perfectly fine for me on several servers (OS X , Linux, FreeBSD, I've no windows readily available). It times out for me with that host of course, but getting that far shows we are already inside the "missing" easy() method. Please know I really want to help I just need details. Here is what I am seeing in regards to the problem you're seeing: this script is attached (what do you get when you run it?): multivac:~ dmuey$ perl -c rt41213.pl rt41213.pl syntax OK multivac:~ dmuey$ ./rt41213.pl email() failed: Mail::Sender::Error: Connection not established at ./rt41213.pl line 8. multivac:~ dmuey$ Show quoted text
> but don't worry, I used Mail::Sender directly and > it worked great, thanks for the help.
It should already be use()d, do you have the latest of both modules? Show quoted text
> Can't call method "easy" without a package or object reference at > /usr/lib/perl5/site_perl/5.8.8/Mail/Sender/Easy.pm line 32.
That line is sub email { Mail::Sender->new()->easy(shift()); } So does 'Mail::Sender->new()' not return an object? perl -le 'use Mail::Sender; print Mail::Sender->new();' This is what it does for me: multivac:~ dmuey$ perl -le 'use Mail::Sender; print Mail::Sender->new();' Mail::Sender=HASH(0x800d80) multivac:~ dmuey$ multivac:~ dmuey$ perl -le 'print $];'; 5.008008 multivac:~ dmuey$ perl -le 'use Mail::Sender; print Mail::Sender->VERSION();' 0.8.13 multivac:~ dmuey$ perl -le 'use Mail::Sender::Easy; print Mail::Sender::Easy->VERSION();' 0.0.5 multivac:~ dmuey$
#!/usr/bin/perl use Mail::Sender::Easy qw(email); my $Host = 'mail.acan.com.mx'; my $From = 'Soporte <soporte@acan.com.mx>'; email({ 'from' => $From, 'to' => 'erik.alvarez[...]acan.com.mx', 'subject' => 'Perl is great!', 'priority' => 2, # 1-5 high to low 'confirm' => 'delivery, reading', 'smtp' => $Host, '_text' => 'Hello *World* :)', '_html' => 'Hello <b>World</b> ', }) or die "email() failed: $@";
Closing since there are no further replies to my inquiries and was not reproducible otherwise and so I can only conclude it had to be a local issue. Feel free to reopen with the answers to my questions in my last post (quoted below), thanks On Wed Nov 26 08:59:14 2008, DMUEY wrote: Show quoted text
> On Tue Nov 25 17:40:37 2008, edav@acan.com.mx wrote:
> > Hi Daniel.
> > Hello Erik, >
> > That is the real code, as the error obviously shows that the problem > > is in YOUR module(easy.pm), your module doesn't seem to work, at
> least
> > in my environment,
> > There is no need to get upset, I'm mearly asking for clarification. > > Your initial report is vague, there no information about how you got > the error, the versions of > any modules involved, etc. (IE your "environment" as you put it above) > > Perhaps this will help in the future: > http://www.catb.org/~esr/faqs/smart-questions.html > http://www.sindominio.net/ayuda/preguntas-inteligentes.html > > Back to the problem: > > The code sample you sent works perfectly fine for me on several > servers (OS X , Linux, > FreeBSD, I've no windows readily available). > > It times out for me with that host of course, but getting that far > shows we are already inside > the "missing" easy() method. > > Please know I really want to help I just need details. Here is what I > am seeing in regards to > the problem you're seeing: > > this script is attached (what do you get when you run it?): > > multivac:~ dmuey$ perl -c rt41213.pl > rt41213.pl syntax OK > multivac:~ dmuey$ ./rt41213.pl > email() failed: Mail::Sender::Error: Connection not established at > ./rt41213.pl line 8. > multivac:~ dmuey$ >
> > but don't worry, I used Mail::Sender directly and > > it worked great, thanks for the help.
> > It should already be use()d, do you have the latest of both modules? >
> > Can't call method "easy" without a package or object reference at > > /usr/lib/perl5/site_perl/5.8.8/Mail/Sender/Easy.pm line 32.
> > That line is > > sub email { Mail::Sender->new()->easy(shift()); } > > So does 'Mail::Sender->new()' not return an object? > > perl -le 'use Mail::Sender; print Mail::Sender->new();' > > This is what it does for me: > > multivac:~ dmuey$ perl -le 'use Mail::Sender; print Mail::Sender-
> >new();'
> Mail::Sender=HASH(0x800d80) > multivac:~ dmuey$ > > multivac:~ dmuey$ perl -le 'print $];'; > 5.008008 > multivac:~ dmuey$ perl -le 'use Mail::Sender; print Mail::Sender-
> >VERSION();'
> 0.8.13 > multivac:~ dmuey$ perl -le 'use Mail::Sender::Easy; print > Mail::Sender::Easy->VERSION();' > 0.0.5 > multivac:~ dmuey$