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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.