Thanks for all the replies folks!!
Here is the current sub I was working on.
I basically pass a size to test against ($feat_size) and return true (1) or false (0) depending on the following...
sub has_smaller { my($f,$job,$step,$layer,$feat_size) = @_; my $size_1; my $size_2; my $tmp_size; my %seen = (); my $feature_list = (); my @unique_list = (); $f->DO_INFO("-t layer -e $job/$step/$layer -d SYMS_HIST"); # datab +ase query initializes "$f->{doinfo}" $feature_list = $f->{doinfo}{gSYMS_HISTsymbol}; # reference to a l +ist of strings undef %seen; @seen{@$feature_list} = (); @unique_list = sort keys %seen; foreach my $sym ( @unique_list ){ if ($sym =~ /^(?!i|ddi)[a-z_]+(\d+(?:\.\d+)?)(?:[a-z](\d+(?:\. +\d+)?))?/){ $size_1 = $1; $size_2 = $2; $tmp_size = $size_1; if (defined $size_2){ $tmp_size = $size_2 if $size_2 < $size_1; } if ($tmp_size < $feat_size){ return 1; } } } return 0; }

In reply to Re: Regex trouble by cyclone
in thread Regex trouble by cyclone

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.