| 1 |
App-REPL v0.012 |
| 2 |
|
| 3 |
0. The install worked, but 'iperl' is complaining that it can't find App::REPL ! |
| 4 |
Why do you hate me? |
| 5 |
|
| 6 |
Try again -- it'll work this time. Sorry, I've no idea why this happens. |
| 7 |
I can't reproduce it after it happens the once. |
| 8 |
|
| 9 |
1. What does the name mean? |
| 10 |
|
| 11 |
Read-Eval-Print-Loop. App-REPL offers an application that reads |
| 12 |
Perl, evaluates it, and tries to print a result. |
| 13 |
|
| 14 |
2. Tries to? |
| 15 |
|
| 16 |
It doesn't bother with 'CODE' refs, for instance. |
| 17 |
|
| 18 |
3. How does it do that at all? Can it only handle simple expressions? |
| 19 |
|
| 20 |
It uses PPI to find a good place within the given Perl to insert an |
| 21 |
assignment. It isn't perfect, and probably you can find places |
| 22 |
where it doesn't print anything useful. |
| 23 |
|
| 24 |
You can type arbitrarily complex Perl, though -- with 'package' |
| 25 |
statements, subroutine definitions, &c. |
| 26 |
|
| 27 |
4. ... all on a single line? :-/ |
| 28 |
|
| 29 |
No. Again, it uses PPI to try and determine if your Perl is |
| 30 |
complete, and if not it will continue to prompt you for the |
| 31 |
rest. |
| 32 |
|
| 33 |
5. Tries to? |
| 34 |
|
| 35 |
Well, Perl isn't Python :-) Without imposing annoying restrictions, |
| 36 |
App-REPL can't know that you meant for the second line to continue |
| 37 |
on from the first, in: |
| 38 |
|
| 39 |
print $a, $b, |
| 40 |
$c, $d; |
| 41 |
|
| 42 |
One error in the current version is that App-Perl doesn't notice |
| 43 |
that this is incomplete: |
| 44 |
|
| 45 |
print qw(a b |
| 46 |
|
| 47 |
It -can- notice, but PPI currently handles quote-like operators |
| 48 |
strangely, treating qw## and qw() in oddly different ways, and I |
| 49 |
want to either resolve that or resolve my thinking about that |
| 50 |
before I add further magic to App-REPL |
| 51 |
|
| 52 |
6. You say 'magic', but I hear 'fragile evil'. What does App-REPL do |
| 53 |
that's fragile and evil? |
| 54 |
|
| 55 |
Well, several things. |
| 56 |
|
| 57 |
1. The current version monkey-patches a bug out of PPI, so that |
| 58 |
I don't have to wait for the next PPI to be released before |
| 59 |
I can get comments on this (alpha, anyway) version of App-REPL. |
| 60 |
|
| 61 |
2. It relies on the way PPI structures things, and -modifies- |
| 62 |
that structure without PPI's knowledge, in ways that I figured |
| 63 |
out through trial and Data::Dumper |
| 64 |
|
| 65 |
3. It uses PadWalker |
| 66 |
|
| 67 |
7. Yow. Anything else I should worry about? |
| 68 |
|
| 69 |
Everything you enter will be eval'd with lengthy prologue and |
| 70 |
epilogue code, first to set up the environment and finally to |
| 71 |
remember what you did to the environment. Although this system |
| 72 |
-does- try to handle packages well, it currently only recognizes |
| 73 |
the final package of your eval. So, if you do: |
| 74 |
|
| 75 |
package A; my $b = 1; package B; |
| 76 |
|
| 77 |
'$b' will not be available for your next eval. |
| 78 |
|
| 79 |
8. You know, your colors are very annoying. Can I turn them off? |
| 80 |
|
| 81 |
Sure, just set the ANSI_COLORS_DISABLED environment variable |
| 82 |
that Term::ANSIColor checks. |
| 83 |
|
| 84 |
|
| 85 |
INSTALLATION |
| 86 |
|
| 87 |
To install this module, run the following commands: |
| 88 |
|
| 89 |
perl Makefile.PL |
| 90 |
make |
| 91 |
make test |
| 92 |
make install |
| 93 |
|
| 94 |
|
| 95 |
COPYRIGHT AND LICENCE |
| 96 |
|
| 97 |
Copyright (C) 2007 Julian Fondren |
| 98 |
|
| 99 |
This program is free software; you can redistribute it and/or modify it |
| 100 |
under the same terms as Perl itself. |