From dfa74a754817dcf2da1f9788a9ad4924bb21efb5 Mon Sep 17 00:00:00 2001 From: Yorhel Date: Thu, 16 Feb 2012 18:55:07 +0100 Subject: Only 'use AnyEvent;' once The others are rather pointless. --- Tanja.pm | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'Tanja.pm') diff --git a/Tanja.pm b/Tanja.pm index d62a30d..0f59159 100644 --- a/Tanja.pm +++ b/Tanja.pm @@ -3,6 +3,10 @@ package Tanja; use strict; use warnings; +# Just make sure it's loaded. It doesn't export anything. +use AnyEvent; + + # Args: [ pattern ], [ tuple ] # Returns: a true value on match, a false value otherwise # TODO: this match() implementation is for experimental purposes only, it @@ -23,7 +27,6 @@ package Tanja::Server; use strict; use warnings; -use AnyEvent; # Create a new server (representing a "network") @@ -81,7 +84,6 @@ package Tanja::Session; use strict; use warnings; -use AnyEvent; # Create a new session (usually called by $serv->session) @@ -143,23 +145,26 @@ package Tanja::ReturnPath; use strict; use warnings; -use AnyEvent; + sub _new { my($own, $cb) = @_; return bless \$cb, $own; } + sub null { my $cb = shift; return !$$cb; } + sub reply { my($cb, $t) = @_; $$cb && AnyEvent::postpone { $$cb->($t); }; } + sub DESTROY { my $cb = shift; my $c = $$cb; @@ -167,6 +172,7 @@ sub DESTROY { undef $$cb; } + 1; # vim:noet:sw=4:ts=4 -- cgit v1.2.3