using Term::Readline my $term = Term::ReadLine->new('some identifier'); my $str = $term->readline('prompt> '); the basic stdin-based Term::ReadLine is built into perl but if the user installs the Gnu ReadLine stuff it will be available transparently using a module only if it's available: BEGIN { eval { require Devel::Size; Devel::Size->import qw/total_size/; }; } if($INC{'Devel/Size.pm'}) { # foooooo } use FindBin qw($RealBin); use lib "$RealBin/lib/perl"; Perl command line args: -n wrap in a while loop -p auto print -l auto chomp and add linefeed -i inplace (asin sed) -a auto split lines into @F