given. If the code executes successfully you'll be shown the result,
otherwise an error message will be returned. Here are a few examples:
- $_ print "Hello, world!\n"
- Hello, world!
- 1
- $_ nosuchfunction
- Compile error: Bareword "nosuchfunction" not allowed while "strict subs" in use at (eval 130) line 5.
+ $_ print "Hello, world!\n"
+ Hello, world!
+ 1
+ $_ nosuchfunction
+ Compile error: Bareword "nosuchfunction" not allowed while "strict subs" in use at (eval 130) line 5.
- $_
+ $_
In the first example above you see the output of the command ("Hello,
world!"), if any, and then the return value of the statement (1).
When you "use" any Perl module, the "import()" will work as expected -
the exported functions from that module are available for immediate use:
- $_ carp "I'm dieeeing!\n"
- String found where operator expected at (eval 129) line 5, near "carp "I'm dieeeing!\n""
- (Do you need to predeclare carp?)
- Compile error: syntax error at (eval 129) line 5, near "carp "I'm dieeeing!\n""
- BEGIN not safe after errors--compilation aborted at (eval 129) line 5.
-
- $_ use Carp
+ $_ carp "I'm dieeeing!\n"
+ String found where operator expected at (eval 129) line 5, near "carp "I'm dieeeing!\n""
+ (Do you need to predeclare carp?)
+ Compile error: syntax error at (eval 129) line 5, near "carp "I'm dieeeing!\n""
+ BEGIN not safe after errors--compilation aborted at (eval 129) line 5.
- $_ carp "I'm dieeeing!\n"
- I'm dieeeing!
- at /usr/share/perl5/Lexical/Persistence.pm line 327
- 1
- $_
+ $_ use Carp
+
+ $_ carp "I'm dieeeing!\n"
+ I'm dieeeing!
+ at /usr/share/perl5/Lexical/Persistence.pm line 327
+ 1
+ $_
+
+ To quit from the shell, hit "Ctrl+D" or "Ctrl+C".
- To quit from the shell, hit "control+d" or "control+c".
+ MSWin32 NOTE: control keys won't work if TERM=dumb
+ because readline functionality will be
+ disabled.
Run Control Files
For particular projects you might well end up running the same commands
To set a new run control file that's also in that directory, pass it as
a filename like so:
- system$ re.pl --rcfile myproject.pc
+ system$ re.pl --rcfile myproject.pc
If the filename happens to contain a forwardslash, then it's used
- absolutely, or realive to the current working directory:
+ absolutely, or relative to the current working directory:
- system$ re.pl --rcfile /path/to/my/project/repl.rc
+ system$ re.pl --rcfile /path/to/my/project/repl.rc
Within the run control file you might want to load plugins. This is
covered in "The REPL shell object" section, below.
the CPAN. Some of the shipped plugins are loaded in the default profile,
mentioned above.
- Writing your own plugins is not difficult, and is discussed in the
- Devel::REPL::Plugin manual page, along with links to the manual pages of
- all the plugins shipped with "Devel::REPL".
+ Writing your own plugins is not difficult once you understand all about
+ Moose and Moose Roles. A Devel::REPL::Plugin manual page is planned but
+ not yet written.
The REPL shell object
From time to time you'll want to interact with or manipulate the
(<http://www.shadowcatsystems.co.uk/>)
CONTRIBUTORS
- Stevan Little - stevan (at) iinteractive.com
+ Stevan Little - stevan (at) iinteractive.com
Alexis Sukrieh - sukria+perl (at) sukria.net
epitaph
- mgrimes - mgrimes (at) cpan dot org
- Shawn M Moore - sartak (at) gmail.com
+ mgrimes - mgrimes (at) cpan (dot) org
+ Shawn M Moore - sartak (at) gmail.com
Oliver Gorwits - oliver on irc.perl.org
+ Chris Marshall
LICENSE
This library is free software under the same terms as perl itself