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
#!/bin/perl 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