NAME Dpchrist::Tag - labels for debug, log, etc., messages DESCRIPTION This documentation describes module revision $Revision: 1.40 $. This is alpha test level software and may change or disappear at any time. SUBROUTINES _filename($) _filename EXPR Returns the caller's filename, or the empty string if undefined. If EXPR is 0, filename corresponds to location where _filename() is called. If EXPR is a positive integer, _filename() goes back EXPR stack frames. Calls Carp::confess() on error. _line($) _line EXPR Returns the caller's line number, or the empty string if undefined. If EXPR is 0, line name corresponds to location where _line() is called. If EXPR is a positive integer, _line() goes back EXPR stack frames. Calls Carp::confess() on error. _package($) _package EXPR Returns the package name, or the empty string if undefined. If EXPR is 0, package name corresponds to location where _package() is called. If EXPR is a positive integer, _package() goes back EXPR stack frames. Calls Carp::confess() on error. _subroutine _subroutine EXPR Returns the subroutine name, or the empty string if undefined. Note that (caller($n))[3] is normally undefined outside of subroutines, anonymous subroutines, eval's, etc.. If EXPR is 0, subroutine name corresponds to location where _subroutine() is called. If EXPR is a positive integer, _subroutine() goes back EXPR stack frames. Calls Carp::confess() on error. _tag _tag EXPR Returns a string of the form: 'filename line subbase ' Where subbase is whatever follows the last '::' of the subroutine name. If subroutine is the empty string, returns: 'filename line ' If filename is the empty string, returns the empty string. If EXPR is 0, tag corresponds to location where _tag() is called. If EXPR is a positive integer, _tag() goes back EXPR stack frames. Calls Carp::confess() on error. __FILE*__ __FILE0__ __FILE1__ __FILE2__ A set of subroutines for obtaining the file name at the present location and at one and two stack frames up. __LINE*__ __LINE0__ __LINE1__ __LINE2__ A set of subroutines for obtaining the line number at the present location and at one and two stack frames up. __PACKAGE*__ __PACKAGE0__ __PACKAGE1__ __PACKAGE2__ A set of subroutines for obtaining the package name at the present location and at one and two stack frames up. __SUB*__ __SUB__ __SUB0__ __SUB1__ __SUB2__ A set of subroutines for obtaining the subroutine name at the present location (__SUB__ and __SUB0__) and at one and two stack frames up. __TAG*__ __TAG__ __TAG0__ __TAG1__ __TAG2__ A set of subroutines for generating message labels at the present location (__TAG__ and __TAG0__) and at one and two stack frames up. EXPORT None by default. All of the subroutines may be imported by using the ':all' tag: use Dpchrist::Tag qw( :all ); INSTALLATION Old school: $ perl Makefile.PL $ make $ make test $ make install Minimal: $ cpan Dpchrist::Tag Complete: $ cpan Bundle::Dpchrist PREREQUISITES See Makefile.PL in the source distribution root directory. SEE ALSO perldoc -f caller AUTHOR David Paul Christensen dpchrist@holgerdanske.com COPYRIGHT AND LICENSE Copyright 2010 by David Paul Christensen dpchrist@holgerdanske.com This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.