source: perl/lib/Net/Jabber/Presence.pm @ 4c2ec6c

barnowl_perlaimdebianrelease-1.4release-1.5release-1.6release-1.7release-1.8release-1.9
Last change on this file since 4c2ec6c was cb54527, checked in by Nelson Elhage <nelhage@mit.edu>, 14 years ago
Getting rid of indirect object syntax new calls. Quoting perlobj: > But what if there are no arguments? In that case, Perl must guess what > you want. Even worse, it must make that guess *at compile time*. Usually > Perl gets it right, but when it doesn't you get a function call compiled > as a method, or vice versa. This can introduce subtle bugs that are hard > to detect. > > For example, a call to a method "new" in indirect notation -- as C++ > programmers are wont to make -- can be miscompiled into a subroutine > call if there's already a "new" function in scope. You'd end up calling > the current package's "new" as a subroutine, rather than the desired > class's method. The compiler tries to cheat by remembering bareword > "require"s, but the grief when it messes up just isn't worth the years > of debugging it will take you to track down such subtle bugs.
  • Property mode set to 100644
File size: 2.0 KB
Line 
1#############################################################################
2#
3#  This library is free software; you can redistribute it and/or
4#  modify it under the terms of the GNU Library General Public
5#  License as published by the Free Software Foundation; either
6#  version 2 of the License, or (at your option) any later version.
7#
8#  This library is distributed in the hope that it will be useful,
9#  but WITHOUT ANY WARRANTY; without even the implied warranty of
10#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11#  Library General Public License for more details.
12#
13#  You should have received a copy of the GNU Library General Public
14#  License along with this library; if not, write to the
15#  Free Software Foundation, Inc., 59 Temple Place - Suite 330,
16#  Boston, MA  02111-1307, USA.
17#
18#  Copyright (C) 1998-2004 Jabber Software Foundation http://jabber.org/
19#
20##############################################################################
21
22package Net::Jabber::Presence;
23
24=head1 NAME
25
26Net::Jabber::Presence - Jabber Presence Module
27
28=head1 DESCRIPTION
29
30  Net::Jabber::Presence inherits all of its methods from
31  Net::XMPP::Presence.
32
33=head1 AUTHOR
34
35Ryan Eatmon
36
37=head1 COPYRIGHT
38
39This module is free software; you can redistribute it and/or modify
40it under the same terms as Perl itself.
41
42=cut
43
44require 5.003;
45use strict;
46use Carp;
47use Net::XMPP::Presence;
48use base qw( Net::XMPP::Presence );
49
50use vars qw( $VERSION );
51
52$VERSION = "2.0";
53
54sub GetX     { my $self = shift; $self->GetChild(@_);    } 
55sub DefinedX { my $self = shift; $self->DefinedChild(@_); }
56sub NewX     { my $self = shift; $self->NewChild(@_);    }
57sub AddX     { my $self = shift; $self->AddChild(@_);    } 
58sub RemoveX  { my $self = shift; $self->RemoveChild(@_); }
59
60sub _new_jid    { my $self = shift; return Net::Jabber::JID->new(@_);      }
61sub _new_packet { my $self = shift; return Net::Jabber::Stanza->new(@_);   }
62sub _presence   { my $self = shift; return Net::Jabber::Presence->new(@_); }
63
641;
Note: See TracBrowser for help on using the repository browser.