Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

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.

by 1nickt (Friar)
on Aug 04, 2015 at 04:10 UTC ( #1137329=note: print w/ replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1137329]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (7)
As of 2015-08-04 06:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The oldest computer book still on my shelves (or on my digital media) is ...













    Results (59 votes), past polls