How can I start an interactive console for Perl?

前端 未结 23 2439
故里飘歌
故里飘歌 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 07:51

    I always did:

    rlwrap perl -wlne'eval;print$@if$@'
    

    With 5.10, I've switched to:

    rlwrap perl -wnE'say eval()//$@'
    

    (rlwrap is optional)

提交回复
热议问题