App-PerlShell

 view release on metacpan or  search on metacpan

bin/plsh.pl  view on Meta::CPAN


PLSH - Perl Shell

=head1 SYNOPSIS

 plsh [options] [args]

=head1 DESCRIPTION

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

=head1 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

=cut

 -w                   Treat each element of args as a separate
 --words              entry for @ARGV.

=pod

 --help               Print Options and Arguments.
 --man                Print complete man page.
 --versions           Print Modules, Perl, OS, Program info.

=head1 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" }

=head1 ORDER

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

=over 4

=item 1

Prepend any -I paths to @INC.

=item 2

Set -P package.  If provided, set -e to "use E<lt>packageE<gt>".

=item 3

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

=item 4

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

=item 5

Add any additional -e arguments to -e.

=item 6

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

=back

=head1 EXAMPLES

The following two examples accomplish the same thing.

=head2 Command Line

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

=head2 Interactive

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

=head1 SEE ALSO

L<App::PerlShell>

=head1 LICENSE



( run in 0.847 second using v1.01-cache-2.11-cpan-e1769b4cff6 )