develooper Front page | perl.qpsmtpd | Postings from July 2005

Re: RFC: Use Class::Frame (was Re: Great news from YAPC)

Thread Previous | Thread Next
From:
Matt Sergeant
Date:
July 6, 2005 13:56
Subject:
Re: RFC: Use Class::Frame (was Re: Great news from YAPC)
Message ID:
687d71a3d87cb1ac0b33d18461fbd798@sergeant.org
On 6 Jul 2005, at 16:51, Charlie Brady wrote:

> Thoughts?

I'd rather just eval those subs into existence than need another CPAN 
module to do something so easy.

Something like:

BEGIN {
    my @fields = qw( remote_host remote_ip remote_info remote_port
                     local_ip local_port
                     relay_client hello hello_host)
    );
    foreach my $f (@fields) {
       eval 'sub ' . $f . ' { my $self = shift;
               @_ and $self->{_' . $f . '} = shift;
               $self->{_' . $f . '};
             }';
    }
}


Thread Previous | Thread Next


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