psh - Developing for Perl Shell
Developing for the Perl Shell.
The -d option puts psh into "debugging" mode, which prints diagnostic output. Note that you can also enter/leave this debugging mode in a running psh via the $Psh::debugging variable.
$Psh::debugging
Possible values for -d/$Psh::debugging are either 0 to disable it, 1 to enable all debug messages or a string of characters where each character denotes a certain class of debug messages.
s
o
f
i
e
c
Even though psh aims to be an interactive shell instead of a scripting environment, speed is important. The main concern here is that startup speed of psh, which is primarily determined by two factors:
The startup time on a normal, not to busy, computer should be smaller than one second. To make this possible, keep some simple rules in mind:
require
use
applies
On startup, psh scans the Psh::Builtins:: namespace and will add the names of all found dynamic loadable builtins to %Psh::built_ins.
psh
%Psh::built_ins
During evaluation of an input line, psh will first check the %Psh::built_ins variable. If this fails it will try to locate an appropriate built-in function in Psh::Builtins.pm.
A dynamical loadable builtin has to be in a file called Builtinname.pm within the Psh::Builtins:: namespace and has at least one subroutine, called 'bi_builtinname'. Additionally, it may provide a cmpl_builtinname subroutine for a custom completion. Furthermore, a builtin should contain some pod documentation, starting with "=item * " and ending with "=cut". The builtin will be called with 2 arguments, the first one if the rest of the line while the second one is an array to all the words psh discovered.
For a list of the predefined psh builtins, use the "help" command from within psh.
Currently empty due to overhaul of strategies
Copyright (C) 1999-2003 Gregor N. Purdy. All rights reserved. This script is free software. It may be copied or modified according to the same terms as Perl itself.
To install Psh, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Psh
CPAN shell
perl -MCPAN -e shell install Psh
For more information on module installation, please visit the detailed CPAN module installation guide.