in reply to Shell style line-editing without benefit of CPAN modules

Is there a way to get a line editing function using the arrow keys just using POSIX (or some other standard approach) without access to any of the extended functionality provided by CPAN modules?

Of course. How do you think the author of Term::ReadLine and friends did it? Of particular interest to you might be Term::ReadLine::Zoid, a pure-perl Term::ReadLine implementation.

So perhaps you've guessed by now: There is no functional Term::Readline or Term:Readkey on these systems, and I cannot install one.

Bullshit. You just haven't figured out how to install one yet! Hell, if you succeed in your attempt to reinvent Term::ReadLine you'll have done it via the hardest possible route - recode it by hand! Here's a few easier possibilities:

-sam

  • Comment on Re: Shell style line-editing without benefit of CPAN modules

Replies are listed 'Best First'.
Re^2: Shell style line-editing without benefit of CPAN modules
by SirBones (Friar) on Nov 18, 2006 at 22:27 UTC
    Find a new job. Coding in Perl without CPAN is a foolish waste of time with very little to recommend it.

    True enough. Although I'd still like Perl even without CPAN. ;-)

    I should make it clear however that this is a very unusual situation; this restriction is definitely not business as usual, and everyone understands that.

    Thanks for the pointers, I think that will get me going.

    -Ken

    "This bounty hunter is my kind of scum: Fearless and inventive." --J.T. Hutt
      True enough. Although I'd still like Perl even without CPAN. ;-)

      To be honest, I don't. If CPAN weren't a factor I'm sure I'd have switched long ago - Scheme, Python and TCL all have syntax that makes more sense to me. CPAN, both as a place to find code and a place to share it, is what makes Perl my language of choice.

      Re-reading, I realized I forgot to throw in a link to Krang. Krang is a big hairy Apache/mod_perl app that can be distributed and installed without requiring any external modules. It packages the CPAN modules it needs and has a build system that allows you to build on one machine and install on another. Overkill for a little script, perhaps, but another take on the problem.

      -sam

        Hmm, wonder then how CPAN got so big in the first place... Yes, given Perl is rather old, but still. Perl 5 came 1994, Python came 1990, and Ruby 1995...