I have a simple question.
i have an array that has various kinds of information in it and (5) fields that i want to do something special with.

Now here is the question:
Currently my condition looks like this :
if (defined (@array[9..13]) and @array[9..13] ne "") { &my_sub (); }
The Problem with the above conditional is that it will only run &my_sub if all of the 5 array values have some value present in them.
This is what i want to fix. I want to run the sub even if (two or any number) of the five arrays are present.

I guess this will mean that i would have to look at each of these 5 first and do a loop of some kind on each one that is present. But when i tried to use a foreach my result screwed up.

Example

@array = ( name, address, age, date1, date2, date3, date4, date5); Take date1 .. date5; on each encountered date run spcial sub to process each date input(whi +ch you dont woory about).

Thanks Go-Juve


In reply to simple array condition by Anonymous Monk

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.