develooper Front page | perl.pep | Postings from May 2010

Re: I do not understand the error CGI that I get CGI using Email::Simple

Thread Previous
From:
Ricardo Signes
Date:
May 4, 2010 05:39
Subject:
Re: I do not understand the error CGI that I get CGI using Email::Simple
Message ID:
20100504123908.GA3417@cancer.codesimply.com
* fakessh <fakessh@fakessh.eu> [2010-05-04T08:20:14]
> [Tue May 04 14:15:11 2010] [error] [client 90.30.250.62] Can't use string
> ("fakessh@fakessh.eu") as a HASH ref while "strict refs" in use at
> /usr/lib/perl5/vendor_perl/5.8.8/Email/Simple.pm line 100., referer:

This is a warning, not an error.

> [Tue May 04 14:15:11 2010] [error] [client 90.30.250.62] Premature end of
> script headers: webmail.pl, referer:

It looks like your program just isn't behaving correctly.

> >> > package PerlWebmail::Message;
> >> > use base qw(MIME::Lite);
> >> > use base qw(Email::Simple);
> > 
> > Extending both those classes at once seems doomed to fail a lot.
> 
> I can well use Email:: Simple in a CGI

That is not the point.  You are trying to create a class that inherits from two
distinct and contradictory classes.  This will fail.

> >> > sub mail 
> >> > {
> >> >     my ($self, $message) = @_;
> >> >     my $obj = Email::Simple->new($message);
> >> >     print $obj->as_string;
> >> >     $Self->new;
> >> > }
> > 
> > You said $Self instead of $self.
> 
> typographical error 
> the correcting operation in the class is ok

Don't retype fake code.  Show things that actually fail.

Your program, as shown, makes no sense and will never do anything useful.

-- 
rjbs

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About