my $term; if (-t STDIN) { $term = Term::ReadLine->new('My Application'); } else { $term = Term::ReadLine->new('My Application', \*STDIN, \*STDOUT); }