App-REPL
view release on metacpan or search on metacpan
lib/App/REPL.pm view on Meta::CPAN
package App::REPL;
use warnings;
use strict;
use Data::Dumper;
use PadWalker 'peek_my';
use Term::ANSIColor ':constants';
$Term::ANSIColor::AUTORESET = 1;
require Exporter;
use vars qw(@ISA @EXPORT $VERSION);
$VERSION = '0.012';
@ISA = qw(Exporter);
@EXPORT = qw(x p env ret rdebug help);
# ----------------------------------------------------------------------
sub x { print Dumper @_ }
sub p { print @_, "\n" }
sub env { peek_my(1) }
sub ret { $App::REPL::ret }
sub rdebug {
if (@_) { $App::REPL::DEBUG = shift } else { $App::REPL::DEBUG++ }
print YELLOW "Debug level set to $App::REPL::DEBUG\n"
}
sub help {
if (@_ and shift eq 'commands') {
system perldoc => 'App::REPL'
}
else {
print YELLOW <<EOH;
Auto-imported commands (from App::REPL): x p env ret rdebug help
See also: C<help 'commands'>
EOH
}
}
1;
__END__
# ----------------------------------------------------------------------
=head1 NAME
App::REPL - A container for functions for the iperl program
=head1 VERSION
Version 0.01
=head1 SYNOPSIS
This module contains functions that the iperl program automatically
imports into any package it enters, for interactive convenience.
Please see the README for general information.
=head1 EXPORT
=head1 FUNCTIONS
=head2 x
Print arguments with C<Data::Dumper::Dumper>
=head2 p
( run in 1.310 second using v1.01-cache-2.11-cpan-39bf76dae61 )