Taking the parts of your guidance request in reverse order:

"to get the desired output I am looking for"

Is printing a simple "E" or "L" your "desired output?" If so, do you nonetheless think the second snippet is somehow deficient? If so, how?

"I just need to be guided on to where to put the code.... "

Probably it would be best to put the second snippet into the first, after the input from <STDIN> for $cmmdty has run its course.

But what's the point of the second input routine? What is expected when asking user to enter a $lore? Does a $lore have to do with your question?

And at least as much to the point, how much thought did you put into solving your (trivial) question before posting? Why did you bother posting instead of trying your possibilities... or reading the applicable tuts?

Paraphrasing numerous suggestions found in the FAQs and elsewhere here in the Monastery, we really do like to see some genuine effort. That fact that you posted some code hardly obscures the fact that there's very little sign you made any serious effort to answer your actual question.

If I've misconstrued your question or the logic needed to answer it, I offer my apologies to all those electrons which were inconvenienced by the creation of this post.

In reply to Re: Auto Fill - LAZY question! by ww
in thread Auto Fill by PilotinControl

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.