Hi, I was wondering if Perl has a command line interpreter like Python's IDLE, where you can test things readily without having to save them as a program and run them. If not, why? Why is it that Python or Matlab has command line interpreters where you can type 4+3 to get 7, but in Perl, C, Java, etc, you don't have them?

Run Perl with the -d option and it starts in debug mode which you can use as a command line interpreter to print out the values of expressions. The 'p' command tells the Perl debugger to print the value of the expression.

david@david-laptop:~$ perl -de 0

Loading DB routines from perl5db.pl version 1.33
Editor support available.

Enter h or `h h' for help, or `man perldebug' for more help.

main::(-e:1):	0
  DB<1> p 4+3 
7

You can search CPAN for modules that provide a more elaborate command line iterpreter, such as Devel::ptkdb and Perl::Shell

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.