I see. Would it be possible then to change the second condition in order to make sure that; $input has to be equal to arraya or @{$hoa{arraya}}?

Sure, but do you really want that? Are you aware that @{$hoa{arraya}} will again give you 4 when used in a string comparison.

If you mean things like "has to be equal to any element in @{$hoa{arraya}}" you have to say it that way. We can't guess what you want, so you have to be precise when you say what you want.

Lets say I have 50 arrays inside my hash and I want to do something to each value of a specific array based on <STDIN>. I dont want to right out 50 elsif statements... please help!

We might help you, but you have to be more specific. based on <STDIN>" is not specific. What exactly do you want? search an array in which the line from STDIN occurs? Or select an array based on its name, and then do something with that array?


In reply to Re^4: specific array in hash of arrays by moritz
in thread specific array in hash of arrays by kwn

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.