read, eval, print, loop with tabcompletion and persistent lexicals
Documentation is also available straight from the REPL;
re.pl$ perldoc Term::E<TAB> Term::ExtendedColor Term::ExtendedColor::TTY::Colorschemes Term::ExtendedColor::TTY Term::ExtendedColor::Xresources
A list of available modules is created on the first run, or when the --genmod flag is specified.
-g, --genmod re-create a list of available modules on the system -h, --help show the help and exit -v, --version show version info and exit -m, --man show documentation and exit
perldoc My::Module # Invoke perldoc; will use the system $PAGER :q, exit # exit re.pl
The behavior in the prompt is controlled by several variables. First, it's
recommended to have the
Term::ReadLine::Gnu module installed. Without it,
tab-completion and a vi keymap can not be guaranteed.
A couple of records in $HOME/.inputrc will make working with perldoc easier, assuming you are using Bash (or anything other that uses readline) as your shell:
set editing-mode vi set keymap vi-insert $if re.pl "\C-e": "perldoc perlre\n" "\C-g": "perldoc perlguts\n" "\C-o": "perldoc perlop\n"¶ "\C-p": "perldoc perlipc\n" "\C-u": "perldoc perlunicode\n"¶ "\C-v": "perldoc perlvar\n"¶ $endif
Magnus Woldrich CPAN ID: WOLDRICH email@example.com http://japh.se
Based on mst's example REPL in the awesome Eval::WithLexicals distribution.
Copyright (C) 2011 Magnus Woldrich. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Hey! The above document had some coding errors, which are explained below:
Around line 157:
Non-ASCII character seen before =encoding in 'perlop\n"¶'. Assuming UTF-8