EXPORTS
Nothing per default, but can export the following per request:
:all
$default_dumper
__CALLER__
__FUNCTION__
usage
DEBUG_FMT
DEBUG
DEBUG_ERROR
DEBUG_FAIL
RETURN_UNDEF
SHOW_CODE
SHOW_CODEVAL
RETURN_OK
SHOW_ERROR
SHOW_FAIL
SHOW_INT
SHOW_STRING
SHOW_POINTER
SET_ERROR
SET_FAIL
TRACE
TRACE_VOID
# Initializes a new instance of the ArgumentException class. # @param $message The error message that explains the reason for the exception. # @param $paramName The name of the parameter that caused the current exception. sub ArgumentException::new { # $object ($class, $message=, $paramName=) my ($class, $msg, $param) = @_; my $self = { message => $msg // $class, paramName => $param // '', }; return bless $self, $class; }
# This method is called by die with file and line number parameters if # die is called without arguments (or with an empty string) and $@ # contains a reference to this object. sub ArgumentException::PROPAGATE { # $string ($self, $file, $line) my ($self, $file, $line) = @_; my $sub = __CALLER__(2)->{subroutine} // '__ANON__'; my $rv = usage($self->stringify(), $file, $sub); unless ($rv =~ /\n$/s) { $rv .= sprintf(" at %s line %d\n", __CALLER__(2)->{filename} // $file, __CALLER__(2)->{line} // $line ); } return $rv; }
# Creates and returns a string representation of the current exception. sub ArgumentException::stringify { # $string ($self) my ($self) = @_; return sprintf($self->{message}, $self->{paramName}); }
# defines an anonymous subroutine for implementing stringification. require overload; ArgumentException->overload::OVERLOAD( q("") => sub { shift->stringify() } );
NAME
Termbox::Go::Devel - Development tools module
DESCRIPTION
This module contains utility functions for the implementation of Termbox.
COPYRIGHT AND LICENCE
This file is part of the port of Termbox.
Copyright (C) 2024,2025 by J. Schneider
Some library content was taken from the libserialport implementation
which is licensed under LGPL3 licence.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
AUTHORS
2024,2025 by J. Schneider https://github.com/brickpool/
DISCLAIMER OF WARRANTIES
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
REQUIRES
SEE ALSO
SUBROUTINES
DEBUG
DEBUG($msg);
Debug output macro.
DEBUG_ERROR
DEBUG_ERROR($err, $msg);
Debug output macro.
DEBUG_FAIL
DEBUG_FAIL($msg);
Debug output macro.
DEBUG_FMT
DEBUG_FMT($fmt, @args);
Debug output macro.
RETURN_OK
my $scalar = RETURN_OK();
Debug output macro. Returns the string "0E0", which evaluates to 0 as a number, but true as a boolean.
RETURN_UNDEF
RETURN_UNDEF();
Debug output macro.
SET_ERROR
SET_ERROR($val, $err, $msg);
Debug output macro. set $val to $err and prints the message $msg in STRICT mode.
SET_FAIL
SET_FAIL($val, $msg);
Debug output macro. Set $val to $!{EFAULT} and prints the message $msg in STRICT mode.
SHOW_CODE
my $errstr = SHOW_CODE($err);
Debug output macro.
SHOW_CODEVAL
my $errno = SHOW_CODEVAL($err);
Debug output macro.
SHOW_ERROR
my $err = SHOW_ERROR($err, $msg);
Debug output macro.
SHOW_FAIL
my undef = SHOW_FAIL($msg);
Debug output macro.
SHOW_INT
my $scalar = SHOW_INT($scalar);
Debug output macro.
SHOW_POINTER
my \$scalarref | \@arrayref | \%hashref = SHOW_POINTER(\$scalarref | \@arrayref | \%hashref);
Debug output macro.
SHOW_STRING
my $scalar = SHOW_STRING($scalar);
Debug output macro.
TRACE
TRACE($fmt, @args);
Debug output macro.
TRACE_VOID
TRACE_VOID();
Debug output macro.
usage
my $string = usage($message, $filename, $subroutine);
Print usage messages from embedded (auto)pod in file.