in reply to What editing mode am I in when interacting with a Perl script using OS X Terminal? Because the keyboard works differently to a normal shell.

Hi Cody Fendant, I program on OS X and for interactive scripts I use Term::ReadLine::Perl5, which implements most of the Gnu library in Perl, so you have the features roboticus described, as well as your arrow keys back.

#!/usr/bin/perl -w use strict; use Term::Readline::Perl5; my $term = Term::ReadLine::Perl5->new(); my $name = $term->readline( 'Name? ' ); print "Hello, $name\n"; __END__
The way forward always starts with a minimal test.
  • Comment on Re: What editing mode am I in when interacting with a Perl script using OS X Terminal? Because the keyboard works differently to a normal shell.
  • Download Code