use Term::ReadLine;
my $shell = Term::ReadLine->new('myshell');
$_ = $shell->Features();
my $history = ${%$_}{autohistory};
$SIG{INT} = 'IGNORE';
while(1) {
my $return;
$command = $shell->readline('myshell> ');
{ local $SIG{INT} = sub {die 'End';};
$return = eval($command);
}
if (!$history) { $term->addhistory($_) if /\S/;
}
}
####
myshell> @test = (a,b,c,d)
myshell> print "@test";
myshell> a b c d
####
myshell> open OUT, '>/tmp/test';
myshell> print OUT "Hello world !"; close OUT