How can I start an interactive console for Perl?

前端 未结 23 2336
故里飘歌
故里飘歌 2020-12-07 07:37

How can I start an interactive console for Perl, similar to the irb command for Ruby or python for Python?

相关标签:
23条回答
  • 2020-12-07 08:01

    Also look for ptkdb on CPAN: http://search.cpan.org/search?query=ptkdb&mode=all

    0 讨论(0)
  • 2020-12-07 08:02

    Sepia and PDE have also own REPLs (for GNU Emacs).

    0 讨论(0)
  • 2020-12-07 08:05

    Matt Trout's overview lists five choices, from perl -de 0 onwards, and he recommends Reply, if extensibility via plugins is important, or tinyrepl from Eval::WithLexicals, for a minimal, pure-perl solution that includes readline support and lexical persistence.

    0 讨论(0)
  • 2020-12-07 08:06

    Read-eval-print loop:

    $ perl -e'while(<>){print eval,"\n"}'
    
    0 讨论(0)
  • 2020-12-07 08:07

    I think you're asking about a REPL (Read, Evaluate, Print, Loop) interface to perl. There are a few ways to do this:

    • Matt Trout has an article that describes how to write one
    • Adriano Ferreira has described some options
    • and finally, you can hop on IRC at irc.perl.org and try out one of the eval bots in many of the popular channels. They will evaluate chunks of perl that you pass to them.
    0 讨论(0)
提交回复
热议问题