I'm running Mac OS X 10.7.4 and can't reproduce your problem. I tried with both Perl v5.12.3 and Perl v5.14.2 - both produced:
$ pm_readline_mac.pl Enter your arithmetic expression: 1+2 3 Enter your arithmetic expression: 8/2 4 Enter your arithmetic expression: exit $
The only difference is the text I enter: under 5.12.3 it is emboldened; under 5.14.2 it is not.
To run your code, I simply added the following lines before your code:
use strict; use warnings; use Term::ReadLine;
I recall that I initially had problems with CPAN prompts. Installing Term::ReadLine::Perl fixed the problem. Unfortunately, that was some time ago and I don't remember the exact nature of the problem; although, I don't recall getting warning messages. In the absence of other solutions, you could try installing Term::ReadLine::Perl if you don't already have it.
When I was first looking at changing to a Mac, I asked: "Are there any major Perl issues with Mac OS X Lion?". I followed advice regarding installing a separate version of Perl: I took the Perlbrew path - others (MacPorts, ActiveState) are also suggested. You may want to consider these options before adding or updating modules used by your system Perl.
-- Ken
In reply to Re: Term ReadLine in OS X
by kcott
in thread Term ReadLine in OS X
by mightymouse3062
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |