#!/usr/bin/perl use strict; use Term::ReadLine; my $__line = Term::ReadLine->new(''); my $t; $SIG{"INT"} = "quit"; $| = 1; while(1){ $t = ""; $t .= $__line->readline("####\$ ") until ($t =~ m/q$|run$/g); chomp($t); exit() if ($t eq 'q'); eval("$1") if($t =~/(.*)run$/) } sub quit { print "\n Dou you realy want to quit:[q to quit]"; chomp($t = <>); }