0

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?

2
Contributors
1
Reply
2
Views
5 Years
Discussion Span
Last Post by d5e5
0

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

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.