3

Languages like Ruby, Python, Lua, PHP, Node.js, etc. have a simple "shell" where you can type simple one-liners and see the result. Does Perl has something similar? I'm not looking for something fancy that does pretty printing (I'll use print()) or accepts multiline input.

The story is this:

I need to experiment with some regexps. I know I can do perl -e "..." but then I need to shell-escape the code and this complicates matters. If I had a Perl shell I wouldn't need to worry about escaping.

Niccolo M.
  • 3,363
  • 2
  • 22
  • 39
  • Ok, I see that the question is indeed answered there. Sorry. – Niccolo M. Dec 23 '13 at 13:16
  • I usually find that using single quotes in -e is good enough for most purposes: `perl -e 'print "my data here\n"'` –  Dec 23 '13 at 13:21
  • 1
    For the specific problem of interactively experimenting with regexps, try `rxrx` from [Regexp::Debugger](https://metacpan.org/pod/Regexp::Debugger). – cjm Dec 23 '13 at 16:10

2 Answers2

2

Have a try with this CPAN module:

Perl::Shell

Suic
  • 2,441
  • 1
  • 17
  • 30
Toto
  • 89,455
  • 62
  • 89
  • 125
2

Have you ever tried Reply.pm? I'm using it.

https://metacpan.org/release/Reply

ernix
  • 3,442
  • 1
  • 17
  • 23