The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

PLSH - Perl Shell

SYNOPSIS

 plsh [options] [args]

DESCRIPTION

Creates an interactive Perl shell. Startup configuration commands written in Perl syntax can be stored in '.plshrc' file in HOME directory (e.g., $HOME on Linxu, %USERPROFILE% on Windows) which will initialize the Perl Shell on every startup.

OPTIONS

 -E                   Exit after -e commands complete.
 --exit

 -e                   Valid Perl to execute.  Multiple valid Perl
 --execute            statements (semicolon-separated) and multiple
                      -e allowed.

 -f                   Perl feature set to use.  Example: ":5.10"
 --feature            DEFAULT:  (or not specified) ":default"

 -I dir               Specify directory to prepend @INC.  Multiple
 --Include            -I allowed.

 -l                   Require "my" for all variables.
 --lexical            Requires Lexical::Persistence, fails if not found.

 -P package           Package to use as namespace.  Will:
 --package              use `package';
                      before any -e arguments.

 -p prompt            Prompt for the shell.
 --prompt

 -s file              Session command log file.
 --session

 -V                   Output verbose initialization information.
 --verose
 --help               Print Options and Arguments.
 --man                Print complete man page.
 --versions           Print Modules, Perl, OS, Program info.

CONFIGURATION

An example '.plshrc' file.

    use App::PerlShell::Plugin::Macros;

    # do not require a semicolon to terminate each line
    $ENV{PERLSHELL_SEMIOFF}=1;
    # turn on feature 5.10 (use feature ':5.10';)
    $ENV{PERLSHELL_FEATURE}=":5.10";

    # override the `version` command
    no warnings 'redefine'; *App::PerlShell::version = sub { print "MyVersion" }

ORDER

Command line options -f, -p, -P override .'plshrc'.

  1. Prepend any -I paths to @INC.

  2. Set -P package. If provided, set -e to "use <package>".

  3. Add any commmands from '$HOME/.plshrc' file if exists in HOME directory.

  4. Add any commmands from '.plshrc' file if exists in working directory.

  5. Add any additional -e arguments to -e.

  6. If -E, add "exit;" to end of -e.

EXAMPLES

The following two examples accomplish the same thing.

Command Line

 plsh.pl -e "print join ' ', @ARGV;" -E hello world

Interactive

 C:\> plsh.pl
 Perl> print "hello world";
 Perl> exit;

SEE ALSO

App::PerlShell

LICENSE

This software is released under the same terms as Perl itself. If you don't know what that means visit http://perl.com/.

AUTHOR

Copyright (c) 2015-2022 Michael Vincent

http://www.VinsWorld.com

All rights reserved