perl - REPL perl

Perl unlike its successor, it does not natively has hte REPL (READ, Evaluate, Print, Loop) interface to perl . so it does not suppport something like in Python where you can type something or getting help to play with some idea and then put them into code. 

 

"How can I start an interactive console for perl": people has discussed some ideal on the REPL., one of hte suggestion here is to write some code as follow

 

#!/ms/dist/perl5/PROJ/core/5.8/bin
use Carp;


while (<>) {
    chomp;
    my $result = eval;
    print "$_ = $result\n";
}

 

However, this is not a elegant solutoin, if you you really want to have REPL in perl, you may looks at 

 

Dave Rolsky: stackoverlow 写道
Not only did Matt Trout write an article about a REPL, he actually wrote one - Devel::REPL
 

你可能感兴趣的:(perl)