return $ph;
}
-sub tag {
- my $ph = shift;
- return unless $ph;
- return *$ph->{tag};
-}
-
-sub name {
- my $ph = shift;
- return unless $ph;
- return *$ph->{name};
-}
-
-sub version {
- my $ph = shift;
- return unless $ph;
- return *$ph->{version};
-}
-
-sub desc {
- my $ph = shift;
- return unless $ph;
- return *$ph->{desc};
-}
-
-sub author {
- my $ph = shift;
- return unless $ph;
- return *$ph->{author};
-}
-
-sub email {
- my $ph = shift;
- return unless $ph;
- return *$ph->{email};
-}
-
-sub url {
- my $ph = shift;
- return unless $ph;
- return *$ph->{url};
-}
-
-sub banner {
- my $ph = shift;
- return unless $ph;
- return *$ph->{banner};
-}
+eval "sub $_ { *\$_[0]->{$_} }"
+ for qw/tag name version desc author email url banner/;
sub print {
my $ph = shift;
sub PRINTF { shift->printf(@_) }
-my $ph = new __PACKAGE__, name => 'Extended Xchat Perl Interface',
- desc => 'Adds extended support for Perl scripts',
- author => 'Vincent Pit (VPIT)',
- email => 'perl@profvince.com',
- url => 'http://www.profvince.com';
+my $ph = __PACKAGE__->new(
+ name => 'Extended Xchat Perl Interface',
+ desc => 'Adds extended support for Perl scripts',
+ author => 'Vincent Pit (VPIT)',
+ email => 'perl@profvince.com',
+ url => 'http://www.profvince.com',
+);
1;