My end goal in this situation is just to be able to use arrow keys for browsing through different areas of a script. Whenever an arrow key is pressed I want it to run a new subroutine as specified.
That is not your end goal - that is still a method for accomplishing it. What task does your script accomplish? Think PHB big picture. Or are you saying you are trying to build a text editor? It sounds like you are trying to create a command line interface (CLI) for existing libraries.
I am very new to perl, and it is essentially my first programming language.
The language is Perl, the program is perl, just so you know. For someone with not a lot of background, you have selected a very hairy task to cut your teeth on. I would suggest sticking with the simple inputs ('q', 'w') unless there is a strong reason for changing. I have been doing this a while, and I would have pause before picking up the task you've laid out.
The entire script, with its 5 or so modules, is about 8000-9000 lines
Are you modifying a script that someone else wrote? Wrapping other people's code?

I note that in your original code, you have goto. I have never used a goto in a Perl script - the more natural solution is (usually) a dispatch table.


In reply to Re^5: Regex arrow key problem by kennethk
in thread Regex arrow key problem by austin43

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.