use Term::ReadLine; my $tty='/dev/pts/5'; open my $out,'>',$tty; open my $in,'<',$tty; my $term = Term::ReadLine->new('Simple Perl calc',$in,$out); my $prompt = "Enter code: "; my $OUT = $term->OUT || \*STDOUT; while ( $_ = $term->readline($prompt) ) { my $res = eval($_); warn $@ if $@; print $OUT $res, "\n" unless $@; $term->addhistory($_) if /\S/; } #### > ls -l /proc/31965/fd/ insgesamt 0 lrwx------ 1 lanx lanx 64 Dez 1 17:18 0 -> /dev/pts/5 lrwx------ 1 lanx lanx 64 Dez 1 17:18 1 -> /dev/pts/5 lrwx------ 1 lanx lanx 64 Dez 1 17:18 2 -> /dev/pts/5