954,523 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Does Perl have a command line interpreter like Python Idle?

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?

Cupidvogel
Newbie Poster
22 posts since Sep 2011
Reputation Points: 10
Solved Threads: 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

d5e5
Practically a Posting Shark
810 posts since Sep 2009
Reputation Points: 159
Solved Threads: 159
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You