The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.


BW::Base - Base routines for BW::* modules


BW-Lib (collectively, the BW::* module tree) is a set of perl modules developed by Bill Weinman over the course of about 15 years. It provides a uniform interface for a number of common functions, most of which are available elsewhere with other interfaces.

This library duplicates the functionality of a number of other common modules, so there is very little here that is unique. It's not designed to be "better" -- only more uniform, and therefor easier to use (at least I find it so).

It's on CPAN so that it can be easily installed for the various applications that I distribute that use it.


The BW::Base class provides common methods inhereted by the other modules in the BW::* tree. It is not designed to be used directly.

new( [ key => value [, ...] ] )

Constructs a new BW::* object while providing optional object properties. This method is commonly inherited by BW::* classes and is rarely overriden.

_init( [ key => value [, ...] ] )

Called by new() and designed to populate object properties using the corresponding setters. _init() is typically inherited by BW::* classes and is occiasionally augmented, but rarely overridden.

_setter_getter( [ value ] )

A convenience method called by the various setter/getters like this:

    sub foo { BW::Base::_setter_getter(@_); }

_setter_getter() uses caller() to get the name of the calling sub and uses that name for the associated property.

debug( message )

Used to write lines to a web log, debug() prints to STDERR and uses caller() to get the name of the calling sub.

_error( messgae )

Use for setting error messages. Returns FAILURE so that it may be called like:

    if( $badness ) { return $self->_error("I've been bad"); }

Returns and clears the object error message.

checkerror( object )

Used for checking errors from other BW::* modules. Returns FAILURE and sets an error (using $self-_error()>) or SUCCESS if no error found.


Written by Bill Weinman <>.


Copyright (c) 1995-2010 The BearHeart Group, LLC


See HISTORY file.