Jeff Kowalczyk wrote:

> I'd like to open perl and execute a few commands interactively in the
> console. I learn a lot in python this way, and I need to understand some
> perl code. Did this kind of thing ever get added to perl?

yes but probably not in a sense that you expect it. the perl debugger can be 
involved to work like an interactive Perl environment:

[panda]# perl -de 1

... [snip a few lines] ...

 main::(-e:1):   1
  DB<1>

at the DB<1> prompt, you can eneter anything you want. if it's not 
recognized by the debugger, it's passed directly to eval so you can do 
stuff like:

DB<1> print "hello world\n"
hello world

DB<3> use strict;

DB<4> use warnings;

DB<5> sub sum{ \
  cont: my $sum = 0; \
  cont: $sum += $_ for(@_); \
  cont: $sum; }

DB<6> print sum(1..5),"\n";
15

DB<7> q
[panda]#

'q' will exit the debugger. lines ends with '\' signal the debugger to grab 
the next line. it's a little unusually to use the debugger for an 
interactive Perl session but it's capable of doing it.

perldoc perldebug

david
-- 
s,.*,<<,e,y,\n,,d,y,.s,10,,s
.ss.s.s...s.s....ss.....s.ss
s.sssss.sssss...s...s..s....
...s.ss..s.sss..ss.s....ss.s
s.sssss.s.ssss..ss.s....ss.s
..s..sss.sssss.ss.sss..ssss.
..sss....s.s....ss.s....ss.s

,....{4},"|?{*=}_'y!'+0!$&;"
,ge,y,!#:$_(-*[./<[EMAIL PROTECTED],b-t,
.y...,$~=q~=?,;^_#+?{~,,$~=~
y.!-&*-/:[EMAIL PROTECTED] ().;s,;,
);,g,s,s,$~s,g,y,y,%,,g,eval

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to