Jabber-Lite

 view release on metacpan or  search on metacpan

lib/Jabber/Lite.pm  view on Meta::CPAN

	my $dval = $self->_check_val( '_debug' );
	if( $dval ){
		$dval = $self->{'_debug'};

		# Do this before invoking caller(); saves oodles of time.
		if( $dval eq "0" ){
			return( 0 );
		}
	}else{
		return( 0 );
	}

	my @calledwith = caller(1);
	my $callingname = $calledwith[3];
	my $callingpkg = $calledwith[0];
	my $lineno = $calledwith[2];
	my $selfref = ref( $self );
	if( $selfref eq $callingpkg ){
		$callingname =~ s/^$callingpkg\:\://g;
	}else{
		$callingname =~ s/^.*://g;
	}

	my $cango = 0;
	if( $dval eq "1" ){
		$cango++;
	}elsif( $dval =~ /(^|,)$callingname(,|$)/ ){
		$cango++;
	}
	print STDERR "DEBUG: $lineno " . time . " $dval:" . $self . "->$callingname: " . $arg . "\n" if( $cango );
	return( $cango );
}

=head2 version

Returns the major version of the library.

=cut

sub version {
	return( $VERSION );
}

=head1 HISTORY

September 2005: During implementation of a Jabber-based project,
the author encountered a machine which for political reasons, could not
be upgraded to a version of perl which supported a current version of
various Jabber libraries.  After getting irritated with having to build
a completely new standalone perl environment, together with the ~10 meg, 
no 11, no 12, no 15 (etc), footprint of libraries required to support 
XML::Parser, the desire for a lightweight Jabber library was born.

December 2005: The author, merrily tossing large chunks of data through
his Jabber servers, discovered that XML::Parser does not deal with
large data sizes in a graceful fashion.

January 2006: The author completed a version which would, at least, not 
barf on most things.

January through September 2006: Being busy with other things, the author
periodically ran screaming from memory leakage problems similar to 
XML::Parser..  Finally, a casual mention in one of the oddest places 
lead the author to a good explanation of how Perl does not deal with
circular dependencies.

=head1 PREREQUISITES / DEPENDENCIES

IO::Socket::INET, IO::Select .  Thats it.  Although, if you want encryption
on your connection, SASL support or reasonable garbage collection in various
versions of perl, there are soft dependencies on:

=over 4

=item IO::Socket::SSL

Library for handling SSL/TLS encryption.

=item MIME::Base64

This is used for some authentication methods.

=item Authen::SASL

SASL magic.  Hooray.

=item Digest::SHA1

This is used for some authentication methods.

=item Scalar::Util

Helps with memory management, saving this library from being caught in
the hell of circular dependencies, which in turn avoids circular 
dependencies from making the use of this library hell on memory, which if I
remember avoids the circular dependency hell.

=back

=head1 BUGS

Perl's garbage collection is at times rather dubious.  A prime example
is when you have double-linked lists, otherwise known as circular 
references.  Since both objects refer to each other (in recording
parent <-> child relationships), perl does not clean them up until the
end of the program.  Whilst this library does do some tricks to get around
this in newer versions of perl, involving proxy objects and 
'weaken' from Scalar::Util , this library may leak memory in older versions
of perl.  Invoking ->hidetree on a retrieved object before it falls out
of scope is recommended (the library does this on some internal objects,
perhaps obsessively).  Note that you may need to create a copy of a
object via newNodeFromStr/toStr due to this.

=head1 AUTHOR

Bruce Campbell, Zerlargal VOF, 2005-7 .  See http://cpan.zerlargal.org/Jabber::Lite

=head1 COPYRIGHT

Copyright (c) 2005-7 Bruce Campbell.  All rights reserved.  
This program is free software; you can redistribute it and/or 



( run in 1.305 second using v1.01-cache-2.11-cpan-13bb782fe5a )