Thursday, April 2, 2009

Perl ReadLine like CPAN

use Term::ReadLine;
my $term = new Term::ReadLine('template');
$stash->set('readline' => sub {
my $prompt = shift || 'input:';
my $text = $term->readline($prompt);
if (defined $text) {
$term->addhistory($text);
}
return $text;
});

Reference:
http://www.naney.org/diki/dk/Term::ReadLine.html

1 comment:

Demon said...

Perl is the best scripting language for Text processing and handle regex. I have posted few articles related to those at my blog

http://icfun.blogspot.com/search/label/perl

Also Perl's Cpan has lots of support that I don't even need to think extra while developing project. I didn't find such help on other programming language except Java and .NET