The typical approach uses the Perl debugger, described in the perldebug(1) man page, on an ``empty'' program, like this:

Code

perl -de 42

Now just type in any legal Perl code, and it will be immediately evaluated. You can also examine the symbol table, get stack backtraces, check variable values, set breakpoints, and other operations typically found in symbolic debuggers.