[568] in BarnOwl Developers

home help back first fref pref prev next nref lref last post

[D-O-H] r684 - / branches/par/perl/lib/Net branches/par/perl/lib/Net/Jabber branches/par/perl/lib/Net/Jabber/Dialback branches/par/perl/lib/Net/XMPP branches/par/perl/lib/XML

daemon@ATHENA.MIT.EDU (nelhage@MIT.EDU)
Thu Oct 29 18:07:30 2009

Resent-From: nelhage@mit.edu
Resent-To: barnowl-dev-mtg@charon.mit.edu
To: dirty-owl-hackers@mit.edu
From: nelhage@MIT.EDU
Reply-to: dirty-owl-hackers@MIT.EDU
Date: Mon, 26 Mar 2007 21:04:55 -0400 (EDT)

Author: nelhage
Date: 2007-03-26 21:04:54 -0400 (Mon, 26 Mar 2007)
New Revision: 684

Modified:
   /
   branches/par/perl/lib/Net/Jabber.pm
   branches/par/perl/lib/Net/Jabber/Component.pm
   branches/par/perl/lib/Net/Jabber/Data.pm
   branches/par/perl/lib/Net/Jabber/Dialback.pm
   branches/par/perl/lib/Net/Jabber/Dialback/Result.pm
   branches/par/perl/lib/Net/Jabber/Dialback/Verify.pm
   branches/par/perl/lib/Net/Jabber/IQ.pm
   branches/par/perl/lib/Net/Jabber/Key.pm
   branches/par/perl/lib/Net/Jabber/Log.pm
   branches/par/perl/lib/Net/Jabber/Message.pm
   branches/par/perl/lib/Net/Jabber/Presence.pm
   branches/par/perl/lib/Net/Jabber/Protocol.pm
   branches/par/perl/lib/Net/Jabber/Server.pm
   branches/par/perl/lib/Net/Jabber/Stanza.pm
   branches/par/perl/lib/Net/Jabber/XDB.pm
   branches/par/perl/lib/Net/XMPP.pm
   branches/par/perl/lib/Net/XMPP/Client.pm
   branches/par/perl/lib/Net/XMPP/Debug.pm
   branches/par/perl/lib/Net/XMPP/IQ.pm
   branches/par/perl/lib/Net/XMPP/JID.pm
   branches/par/perl/lib/Net/XMPP/Message.pm
   branches/par/perl/lib/Net/XMPP/Presence.pm
   branches/par/perl/lib/Net/XMPP/Protocol.pm
   branches/par/perl/lib/Net/XMPP/Roster.pm
   branches/par/perl/lib/Net/XMPP/Stanza.pm
   branches/par/perl/lib/XML/Stream.pm
Log:
 r20705@phanatique:  nelhage | 2007-03-26 21:04:37 -0400
 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 changes on: 
___________________________________________________________________
Name: svk:merge
   - 6122c8b4-0e12-0410-9533-8bcd7c66c992:/local/dirty-owl-hacks:24493
6aa88b72-b502-0410-8cb4-a5dd0230fb79:/owl-local:1356
bb873fd7-8e23-0410-944a-99ec44c633eb:/local/barnowl:20704
bb873fd7-8e23-0410-944a-99ec44c633eb:/local/d-o-h:18636
   + 6122c8b4-0e12-0410-9533-8bcd7c66c992:/local/dirty-owl-hacks:24493
6aa88b72-b502-0410-8cb4-a5dd0230fb79:/owl-local:1356
bb873fd7-8e23-0410-944a-99ec44c633eb:/local/barnowl:20705
bb873fd7-8e23-0410-944a-99ec44c633eb:/local/d-o-h:18636

Modified: branches/par/perl/lib/Net/Jabber/Component.pm
===================================================================
--- branches/par/perl/lib/Net/Jabber/Component.pm	2007-03-27 01:04:43 UTC (rev 683)
+++ branches/par/perl/lib/Net/Jabber/Component.pm	2007-03-27 01:04:54 UTC (rev 684)
@@ -53,7 +53,7 @@
 
     use Net::Jabber;
 
-    $Con = new Net::Jabber::Component();
+    $Con = Net::Jabber::Component->new();
 
     $Con->Execute(hostname=>"jabber.org",
                   componentname=>"service.jabber.org",

Modified: branches/par/perl/lib/Net/Jabber/Data.pm
===================================================================
--- branches/par/perl/lib/Net/Jabber/Data.pm	2007-03-27 01:04:43 UTC (rev 683)
+++ branches/par/perl/lib/Net/Jabber/Data.pm	2007-03-27 01:04:54 UTC (rev 684)
@@ -55,7 +55,7 @@
   a Jabber <xdb/> you must pass it the XML::Stream hash from the
   Net::Jabber::Client module.
 
-    my $xdb = new Net::Jabber::XDB(%hash);
+    my $xdb = Net::Jabber::XDB->new(%hash);
 
   There has been a change from the old way of handling the callbacks.
   You no longer have to do the above yourself, a Net::Jabber::XDB
@@ -82,7 +82,7 @@
 
     use Net::Jabber;
 
-    my $xdb = new Net::Jabber::XDB();
+    my $xdb = Net::Jabber::XDB->new();
     $data = $xdb->NewData("jabber:iq:auth");
 
   Now you can call the creation functions for the Data as defined in the

Modified: branches/par/perl/lib/Net/Jabber/Dialback/Result.pm
===================================================================
--- branches/par/perl/lib/Net/Jabber/Dialback/Result.pm	2007-03-27 01:04:43 UTC (rev 683)
+++ branches/par/perl/lib/Net/Jabber/Dialback/Result.pm	2007-03-27 01:04:54 UTC (rev 684)
@@ -37,7 +37,7 @@
   To initialize the Result with a Jabber <db:*/> you must pass it
   the XML::Stream hash.  For example:
 
-    my $dialback = new Net::Jabber::Dialback::Result(%hash);
+    my $dialback = Net::Jabber::Dialback::Result->new(%hash);
 
   There has been a change from the old way of handling the callbacks.
   You no longer have to do the above yourself, a NJ::Dialback::Result
@@ -62,7 +62,7 @@
 
     use Net::Jabber qw(Server);
 
-    $Result = new Net::Jabber::Dialback::Result();
+    $Result = Net::Jabber::Dialback::Result->new();
 
   Now you can call the creation functions below to populate the tag before
   sending it.

Modified: branches/par/perl/lib/Net/Jabber/Dialback/Verify.pm
===================================================================
--- branches/par/perl/lib/Net/Jabber/Dialback/Verify.pm	2007-03-27 01:04:43 UTC (rev 683)
+++ branches/par/perl/lib/Net/Jabber/Dialback/Verify.pm	2007-03-27 01:04:54 UTC (rev 684)
@@ -37,7 +37,7 @@
   To initialize the Verify with a Jabber <db:*/> you must pass it
   the XML::Stream hash.  For example:
 
-    my $dialback = new Net::Jabber::Dialback::Verify(%hash);
+    my $dialback = Net::Jabber::Dialback::Verify->new(%hash);
 
   There has been a change from the old way of handling the callbacks.
   You no longer have to do the above yourself, a NJ::Dialback::Verify
@@ -62,7 +62,7 @@
 
     use Net::Jabber qw(Server);
 
-    $Verify = new Net::Jabber::Dialback::Verify();
+    $Verify = Net::Jabber::Dialback::Verify->new();
 
   Now you can call the creation functions below to populate the tag before
   sending it.

Modified: branches/par/perl/lib/Net/Jabber/Dialback.pm
===================================================================
--- branches/par/perl/lib/Net/Jabber/Dialback.pm	2007-03-27 01:04:43 UTC (rev 683)
+++ branches/par/perl/lib/Net/Jabber/Dialback.pm	2007-03-27 01:04:54 UTC (rev 684)
@@ -37,7 +37,7 @@
   To initialize the Dialback with a Jabber <db:*/> you must pass it
   the XML::Stream hash.  For example:
 
-    my $dialback = new Net::Jabber::Dialback(%hash);
+    my $dialback = Net::Jabber::Dialback->new(%hash);
 
   You now have access to all of the retrieval functions available.
 
@@ -45,8 +45,8 @@
 
     use Net::Jabber qw(Server);
 
-    $DB = new Net::Jabber::Dialback("verify");
-    $DB = new Net::Jabber::Dialback("result");
+    $DB = Net::Jabber::Dialback->new("verify");
+    $DB = Net::Jabber::Dialback->new("result");
 
   Please see the specific documentation for Net::Jabber::Dialback::Result
   and Net::Jabber::Dialback::Verify.
@@ -97,15 +97,15 @@
         else
         {
             my ($temp) = @_;
-            return new Net::Jabber::Dialback::Result()
+            return Net::Jabber::Dialback::Result->new()
                 if ($temp eq "result");
-            return new Net::Jabber::Dialback::Verify()
+            return Net::Jabber::Dialback::Verify->new()
                 if ($temp eq "verify");
 
             my @temp = @{$temp};
-            return new Net::Jabber::Dialback::Result(@temp)
+            return Net::Jabber::Dialback::Result->new(@temp)
                 if ($temp[0] eq "db:result");
-            return new Net::Jabber::Dialback::Verify(@temp)
+            return Net::Jabber::Dialback::Verify->new(@temp)
                 if ($temp[0] eq "db:verify");
         }
     }

Modified: branches/par/perl/lib/Net/Jabber/IQ.pm
===================================================================
--- branches/par/perl/lib/Net/Jabber/IQ.pm	2007-03-27 01:04:43 UTC (rev 683)
+++ branches/par/perl/lib/Net/Jabber/IQ.pm	2007-03-27 01:04:54 UTC (rev 684)
@@ -62,8 +62,8 @@
 sub AddX     { my $self = shift; $self->AddChild(@_);     } 
 sub RemoveX  { my $self = shift; $self->RemoveChild(@_);  }
 
-sub _new_jid    { my $self = shift; return new Net::Jabber::JID(@_);    }
-sub _new_packet { my $self = shift; return new Net::Jabber::Stanza(@_); }
-sub _iq         { my $self = shift; return new Net::Jabber::IQ(@_);     }
+sub _new_jid    { my $self = shift; return Net::Jabber::JID->new(@_);    }
+sub _new_packet { my $self = shift; return Net::Jabber::Stanza->new(@_); }
+sub _iq         { my $self = shift; return Net::Jabber::IQ->new(@_);     }
 
 1;

Modified: branches/par/perl/lib/Net/Jabber/Key.pm
===================================================================
--- branches/par/perl/lib/Net/Jabber/Key.pm	2007-03-27 01:04:43 UTC (rev 683)
+++ branches/par/perl/lib/Net/Jabber/Key.pm	2007-03-27 01:04:54 UTC (rev 684)
@@ -40,7 +40,7 @@
 
 =head2 Basic Functions
 
-    $Key = new Net::Jabber::Key();
+    $Key = Net::Jabber::Key->new();
 
     $key = $Key->Generate();
 
@@ -96,8 +96,8 @@
     my $proto = shift;
     my $self = { };
 
-    $self->{DEBUG} = new Net::Jabber::Debug(usedefault=>1,
-                      header=>"NJ::Key");
+    $self->{DEBUG} = Net::Jabber::Debug->new(usedefault=>1,
+                                             header=>"NJ::Key");
 
     $self->{VERSION} = $VERSION;
     

Modified: branches/par/perl/lib/Net/Jabber/Log.pm
===================================================================
--- branches/par/perl/lib/Net/Jabber/Log.pm	2007-03-27 01:04:43 UTC (rev 683)
+++ branches/par/perl/lib/Net/Jabber/Log.pm	2007-03-27 01:04:54 UTC (rev 684)
@@ -37,7 +37,7 @@
   To initialize the Log with a Jabber <log/> you must pass it the 
   XML::Parser Tree array.  For example:
 
-    my $log = new Net::Jabber::Log(@tree);
+    my $log = Net::Jabber::Log->new(@tree);
 
   There has been a change from the old way of handling the callbacks.
   You no longer have to do the above, a Net::Jabber::Log object is passed
@@ -58,7 +58,7 @@
 
     use Net::Jabber;
 
-    $Log = new Net::Jabber::Log();
+    $Log = Net::Jabber::Log->new();
 
   Now you can call the creation functions below to populate the tag before
   sending it.
@@ -175,8 +175,8 @@
 
     bless($self, $proto);
 
-    $self->{DEBUG} = new Net::Jabber::Debug(usedefault=>1,
-                                                    header=>"NJ::Log");
+    $self->{DEBUG} = Net::Jabber::Debug->new(usedefault=>1,
+                                             header=>"NJ::Log");
 
     if ("@_" ne (""))
     {

Modified: branches/par/perl/lib/Net/Jabber/Message.pm
===================================================================
--- branches/par/perl/lib/Net/Jabber/Message.pm	2007-03-27 01:04:43 UTC (rev 683)
+++ branches/par/perl/lib/Net/Jabber/Message.pm	2007-03-27 01:04:54 UTC (rev 684)
@@ -57,8 +57,8 @@
 sub AddX     { my $self = shift; $self->AddChild(@_);    } 
 sub RemoveX  { my $self = shift; $self->RemoveChild(@_); }
 
-sub _new_jid    { my $self = shift; return new Net::Jabber::JID(@_);     }
-sub _new_packet { my $self = shift; return new Net::Jabber::Stanza(@_);  }
-sub _message    { my $self = shift; return new Net::Jabber::Message(@_); }
+sub _new_jid    { my $self = shift; return Net::Jabber::JID->new(@_);     }
+sub _new_packet { my $self = shift; return Net::Jabber::Stanza->new(@_);  }
+sub _message    { my $self = shift; return Net::Jabber::Message->new(@_); }
 
 1;

Modified: branches/par/perl/lib/Net/Jabber/Presence.pm
===================================================================
--- branches/par/perl/lib/Net/Jabber/Presence.pm	2007-03-27 01:04:43 UTC (rev 683)
+++ branches/par/perl/lib/Net/Jabber/Presence.pm	2007-03-27 01:04:54 UTC (rev 684)
@@ -57,8 +57,8 @@
 sub AddX     { my $self = shift; $self->AddChild(@_);    } 
 sub RemoveX  { my $self = shift; $self->RemoveChild(@_); }
 
-sub _new_jid    { my $self = shift; return new Net::Jabber::JID(@_);      }
-sub _new_packet { my $self = shift; return new Net::Jabber::Stanza(@_);   }
-sub _presence   { my $self = shift; return new Net::Jabber::Presence(@_); }
+sub _new_jid    { my $self = shift; return Net::Jabber::JID->new(@_);      }
+sub _new_packet { my $self = shift; return Net::Jabber::Stanza->new(@_);   }
+sub _presence   { my $self = shift; return Net::Jabber::Presence->new(@_); }
 
 1;

Modified: branches/par/perl/lib/Net/Jabber/Protocol.pm
===================================================================
--- branches/par/perl/lib/Net/Jabber/Protocol.pm	2007-03-27 01:04:43 UTC (rev 683)
+++ branches/par/perl/lib/Net/Jabber/Protocol.pm	2007-03-27 01:04:54 UTC (rev 684)
@@ -77,13 +77,13 @@
 =head2 Basic Functions
 
     use Net::Jabber qw( Client );
-    $Con = new Net::Jabber::Client();                # From
+    $Con = Net::Jabber::Client->new();                # From
     $status = $Con->Connect(hostname=>"jabber.org"); # Net::Jabber::Client
 
       or
 
     use Net::Jabber qw( Component );
-    $Con = new Net::Jabber::Component();             #
+    $Con = Net::Jabber::Component->new();             #
     $status = $Con->Connect(hostname=>"jabber.org",  # From
                             secret=>"bob");          # Net::Jabber::Component
 
@@ -1659,7 +1659,7 @@
     $tag = $Net::Jabber::Query::TAGS{'http://jabber.org/protocol/feature-neg'}
         if exists($Net::Jabber::Query::TAGS{'http://jabber.org/protocol/feature-neg'});
     
-    my $query = new Net::Jabber::Query($tag);
+    my $query = Net::Jabber::Query->new($tag);
     $query->SetXMLNS("http://jabber.org/protocol/feature-neg");
     my $xdata = $query->NewX("jabber:x:data");
     
@@ -2182,7 +2182,7 @@
     my %args;
     while($#_ >= 0) { $args{ lc pop(@_) } = pop(@_); }
 
-    my $query = new Net::Jabber::Stanza("query");
+    my $query = Net::Jabber::Stanza->new("query");
     $query->SetXMLNS("jabber:iq:rpc");
 
     my $source;

Modified: branches/par/perl/lib/Net/Jabber/Server.pm
===================================================================
--- branches/par/perl/lib/Net/Jabber/Server.pm	2007-03-27 01:04:43 UTC (rev 683)
+++ branches/par/perl/lib/Net/Jabber/Server.pm	2007-03-27 01:04:54 UTC (rev 684)
@@ -53,7 +53,7 @@
 
     use Net::Jabber qw(Server);
 
-    $Server = new Net::Jabber::Server();
+    $Server = Net::Jabber::Server->new();
 
     $Server->Start();
     $Server->Start(jabberxml=>"custom_jabber.xml",
@@ -154,15 +154,15 @@
 
     bless($self, $proto);
 
-    $self->{KEY} = new Net::Jabber::Key();
+    $self->{KEY} = Net::Jabber::Key->new();
 
     $self->{DEBUG} =
-        new Net::Jabber::Debug(level=>exists($args{debuglevel}) ? $args{debuglevel} : -1,
-                               file=>exists($args{debugfile}) ? $args{debugfile} : "stdout",
-                               time=>exists($args{debugtime}) ? $args{debugtime} : 0,
-                               setdefault=>1,
-                               header=>"NJ::Server"
-                              );
+        Net::Jabber::Debug->new(level=>exists($args{debuglevel}) ? $args{debuglevel} : -1,
+                                file=>exists($args{debugfile}) ? $args{debugfile} : "stdout",
+                                time=>exists($args{debugtime}) ? $args{debugtime} : 0,
+                                setdefault=>1,
+                                header=>"NJ::Server"
+                               );
 
     $self->{SERVER} = { hostname => "localhost",
                         port => 5269,
@@ -328,7 +328,7 @@
 
     $self->{DEBUG}->Log2("dbresultHandler: dbresult(",$dbresult->GetXML(),")");
 
-    my $dbverify = new Net::Jabber::Dialback::Verify();
+    my $dbverify = Net::Jabber::Dialback::Verify->new();
     $dbverify->SetVerify(to=>$dbresult->GetFrom(),
                          from=>$dbresult->GetTo(),
                          id=>$self->{STREAM}->GetRoot($sid)->{id},

Modified: branches/par/perl/lib/Net/Jabber/Stanza.pm
===================================================================
--- branches/par/perl/lib/Net/Jabber/Stanza.pm	2007-03-27 01:04:43 UTC (rev 683)
+++ branches/par/perl/lib/Net/Jabber/Stanza.pm	2007-03-27 01:04:54 UTC (rev 684)
@@ -1737,8 +1737,8 @@
 sub AddQuery     { my $self = shift; $self->AddChild(@_);     } 
 sub RemoveQuery  { my $self = shift; $self->RemoveChild(@_);  }
 
-sub _new_jid    { my $self = shift; return new Net::Jabber::JID(@_);    }
-sub _new_packet { my $self = shift; return new Net::Jabber::Stanza(@_); }
+sub _new_jid    { my $self = shift; return Net::Jabber::JID->new(@_);    }
+sub _new_packet { my $self = shift; return Net::Jabber::Stanza->new(@_); }
 
 
 sub _CustomSet_init

Modified: branches/par/perl/lib/Net/Jabber/XDB.pm
===================================================================
--- branches/par/perl/lib/Net/Jabber/XDB.pm	2007-03-27 01:04:43 UTC (rev 683)
+++ branches/par/perl/lib/Net/Jabber/XDB.pm	2007-03-27 01:04:54 UTC (rev 684)
@@ -43,7 +43,7 @@
   To initialize the XDB with a Jabber <xdb/> you must pass it the 
   XML::Parser Tree array.  For example:
 
-    my $xdb = new Net::Jabber::XDB(@tree);
+    my $xdb = Net::Jabber::XDB->new(@tree);
 
   There has been a change from the old way of handling the callbacks.
   You no longer have to do the above, a Net::Jabber::XDB object is passed
@@ -64,7 +64,7 @@
 
     use Net::Jabber;
 
-    $XDB = new Net::Jabber::XDB();
+    $XDB = Net::Jabber::XDB->new();
     $XDBType = $XDB->NewData( type );
     $XDBType->SetXXXXX("yyyyy");
 
@@ -417,7 +417,7 @@
     my %args;
     while($#_ >= 0) { $args{ lc pop(@_) } = pop(@_); }
 
-    my $reply = new Net::Jabber::XDB();
+    my $reply = Net::Jabber::XDB->new();
 
     $reply->SetID($self->GetID()) if ($self->GetID() ne "");
     $reply->SetType("result");

Modified: branches/par/perl/lib/Net/Jabber.pm
===================================================================
--- branches/par/perl/lib/Net/Jabber.pm	2007-03-27 01:04:43 UTC (rev 683)
+++ branches/par/perl/lib/Net/Jabber.pm	2007-03-27 01:04:54 UTC (rev 684)
@@ -60,11 +60,11 @@
 
     For a client:
       use Net::Jabber;
-      my $client = new Net::Jabber::Client();
+      my $client = Net::Jabber::Client->new();
 
     For a component:
       use Net::Jabber;
-      my $component = new Net::Jabber::Component();
+      my $component = Net::Jabber::Component->new();
 
 =head1 METHODS
 

Modified: branches/par/perl/lib/Net/XMPP/Client.pm
===================================================================
--- branches/par/perl/lib/Net/XMPP/Client.pm	2007-03-27 01:04:43 UTC (rev 683)
+++ branches/par/perl/lib/Net/XMPP/Client.pm	2007-03-27 01:04:54 UTC (rev 684)
@@ -53,7 +53,7 @@
 
     use Net::XMPP;
 
-    $Con = new Net::XMPP::Client();
+    $Con = Net::XMPP::Client->new();
 
     $Con->SetCallbacks(...);
 

Modified: branches/par/perl/lib/Net/XMPP/Debug.pm
===================================================================
--- branches/par/perl/lib/Net/XMPP/Debug.pm	2007-03-27 01:04:43 UTC (rev 683)
+++ branches/par/perl/lib/Net/XMPP/Debug.pm	2007-03-27 01:04:54 UTC (rev 684)
@@ -38,7 +38,7 @@
 
 =head2 Basic Functions
 
-    $Debug = new Net::XMPP::Debug();
+    $Debug = Net::XMPP::Debug->new();
 
     $Debug->Init(level=>2,
 	             file=>"stdout",
@@ -85,7 +85,7 @@
 
 =head1 EXAMPLE
 
-  $Debug = new Net::XMPP:Debug(level=>2,
+  $Debug = Net::XMPP:Debug->new(level=>2,
                                header=>"Example");
 
     $Debug->Log0("test");

Modified: branches/par/perl/lib/Net/XMPP/IQ.pm
===================================================================
--- branches/par/perl/lib/Net/XMPP/IQ.pm	2007-03-27 01:04:43 UTC (rev 683)
+++ branches/par/perl/lib/Net/XMPP/IQ.pm	2007-03-27 01:04:54 UTC (rev 684)
@@ -61,7 +61,7 @@
 
     use Net::XMPP;
 
-    $IQ = new Net::XMPP::IQ();
+    $IQ = Net::XMPP::IQ->new();
     $IQType = $IQ->NewChild( type );
     $IQType->SetXXXXX("yyyyy");
 
@@ -290,7 +290,7 @@
     return $self;
 }
 
-sub _iq { my $self = shift; return new Net::XMPP::IQ(); }
+sub _iq { my $self = shift; return Net::XMPP::IQ->new(); }
 
 $FUNCTIONS{Error}->{path} = 'error/text()';
 

Modified: branches/par/perl/lib/Net/XMPP/JID.pm
===================================================================
--- branches/par/perl/lib/Net/XMPP/JID.pm	2007-03-27 01:04:43 UTC (rev 683)
+++ branches/par/perl/lib/Net/XMPP/JID.pm	2007-03-27 01:04:54 UTC (rev 684)
@@ -41,9 +41,9 @@
     use Net::XMPP;
 
     sub foo {
-      my $foo = new Net::XMPP::Foo(@_);
+      my $foo = Net::XMPP::Foo->new(@_);
       my $from = $foo->GetFrom();
-      my $JID = new Net::XMPP::JID($from);
+      my $JID = Net::XMPP::JID->new($from);
       .
       .
       .
@@ -55,7 +55,7 @@
 
     use Net::XMPP;
 
-    $JID = new Net::XMPP::JID();
+    $JID = Net::XMPP::JID->new();
 
   Now you can call the creation functions below to populate the tag
   before sending it.

Modified: branches/par/perl/lib/Net/XMPP/Message.pm
===================================================================
--- branches/par/perl/lib/Net/XMPP/Message.pm	2007-03-27 01:04:43 UTC (rev 683)
+++ branches/par/perl/lib/Net/XMPP/Message.pm	2007-03-27 01:04:54 UTC (rev 684)
@@ -54,7 +54,7 @@
 
     use Net::XMPP;
 
-    $Mess = new Net::XMPP::Message();
+    $Mess = Net::XMPP::Message->new();
 
   Now you can call the creation functions below to populate the tag
   before sending it.
@@ -314,7 +314,7 @@
     return $self;
 }
 
-sub _message { my $self = shift; return new Net::XMPP::Message(); }
+sub _message { my $self = shift; return Net::XMPP::Message->new(); }
 
 
 $FUNCTIONS{Body}->{path}  = 'body/text()';

Modified: branches/par/perl/lib/Net/XMPP/Presence.pm
===================================================================
--- branches/par/perl/lib/Net/XMPP/Presence.pm	2007-03-27 01:04:43 UTC (rev 683)
+++ branches/par/perl/lib/Net/XMPP/Presence.pm	2007-03-27 01:04:54 UTC (rev 684)
@@ -54,7 +54,7 @@
 
     use Net::XMPP;
 
-    $Pres = new Net::XMPP::Presence();
+    $Pres = Net::XMPP::Presence->new();
 
   Now you can call the creation functions below to populate the tag
   before sending it.
@@ -269,7 +269,7 @@
     return $self;
 }
 
-sub _presence { my $self = shift; return new Net::XMPP::Presence(); }
+sub _presence { my $self = shift; return Net::XMPP::Presence->new(); }
 
 
 $FUNCTIONS{Error}->{path} = 'error/text()';

Modified: branches/par/perl/lib/Net/XMPP/Protocol.pm
===================================================================
--- branches/par/perl/lib/Net/XMPP/Protocol.pm	2007-03-27 01:04:43 UTC (rev 683)
+++ branches/par/perl/lib/Net/XMPP/Protocol.pm	2007-03-27 01:04:54 UTC (rev 684)
@@ -73,7 +73,7 @@
 =head2 Basic Functions
 
     use Net::XMPP qw( Client );
-    $Con = new Net::XMPP::Client();                  # From
+    $Con = Net::XMPP::Client->new();                  # From
     $status = $Con->Connect(hostname=>"jabber.org"); # Net::XMPP::Client
 
     $Con->SetCallBacks(send=>\&sendCallBack,
@@ -2048,7 +2048,7 @@
 {
     my $self = shift;
 
-    return new Net::XMPP::PrivacyLists(connection=>$self);
+    return Net::XMPP::PrivacyLists->new(connection=>$self);
 }
 
 
@@ -2371,7 +2371,7 @@
 {
     my $self = shift;
 
-    return new Net::XMPP::Roster(connection=>$self);
+    return Net::XMPP::Roster->new(connection=>$self);
 }
 
 

Modified: branches/par/perl/lib/Net/XMPP/Roster.pm
===================================================================
--- branches/par/perl/lib/Net/XMPP/Roster.pm	2007-03-27 01:04:43 UTC (rev 683)
+++ branches/par/perl/lib/Net/XMPP/Roster.pm	2007-03-27 01:04:54 UTC (rev 684)
@@ -40,9 +40,9 @@
   
 =head2 Basic Functions
 
-  my $Client = new Net::XMPP::Client(...);
+  my $Client = Net::XMPP::Client->new(...);
 
-  my $Roster = new Net::XMPP::Roster(connection=>$Client);
+  my $Roster = Net::XMPP::Roster->new(connection=>$Client);
     or
   my $Roster = $Client->Roster();
 

Modified: branches/par/perl/lib/Net/XMPP/Stanza.pm
===================================================================
--- branches/par/perl/lib/Net/XMPP/Stanza.pm	2007-03-27 01:04:43 UTC (rev 683)
+++ branches/par/perl/lib/Net/XMPP/Stanza.pm	2007-03-27 01:04:54 UTC (rev 684)
@@ -215,8 +215,8 @@
 use Net::XMPP::Namespaces;
 use vars qw( $AUTOLOAD %FUNCTIONS $DEBUG );
 
-$DEBUG = new Net::XMPP::Debug(usedefault=>1,
-                              header=>"XMPP");
+$DEBUG = Net::XMPP::Debug->new(usedefault=>1,
+                               header=>"XMPP");
 
 # XXX need to look at evals and $@
 
@@ -1411,7 +1411,7 @@
 sub _new_jid
 {
     my $self = shift;
-    return new Net::XMPP::JID(@_);
+    return Net::XMPP::JID->new(@_);
 }
 
 
@@ -1423,7 +1423,7 @@
 sub _new_packet
 {
     my $self = shift;
-    return new Net::XMPP::Stanza(@_);
+    return Net::XMPP::Stanza->new(@_);
 }
 
 

Modified: branches/par/perl/lib/Net/XMPP.pm
===================================================================
--- branches/par/perl/lib/Net/XMPP.pm	2007-03-27 01:04:43 UTC (rev 683)
+++ branches/par/perl/lib/Net/XMPP.pm	2007-03-27 01:04:54 UTC (rev 684)
@@ -60,7 +60,7 @@
 =head1 EXAMPLES
 
       use Net::XMPP;
-      my $client = new Net::XMPP::Client();
+      my $client = Net::XMPP::Client->new();
 
 =head1 METHODS
 

Modified: branches/par/perl/lib/XML/Stream.pm
===================================================================
--- branches/par/perl/lib/XML/Stream.pm	2007-03-27 01:04:43 UTC (rev 683)
+++ branches/par/perl/lib/XML/Stream.pm	2007-03-27 01:04:54 UTC (rev 684)
@@ -680,7 +680,7 @@
         $self->debug(1,"Connect: srv requested");
         if ($NETDNS)
         {
-            my $res = new Net::DNS::Resolver();
+            my $res = Net::DNS::Resolver->new();
             my $query = $res->query($self->{SIDS}->{newconnection}->{srv}.".".$self->{SIDS}->{newconnection}->{hostname},"SRV");
             
             if ($query)


home help back first fref pref prev next nref lref last post