First of all, you can use /x to make that wall of code a lot more readable.

Secondly, you can test the result of the match to verify that you really got 19 values out:

my $result = (($beginning, $agency, $district, $ssn, $serv_per_m, $serv_per_y, $serv_per_t, $last_name, $first_name_i, $middle_name_i, $cover_group, $pay_code, $pay_rate, $earnings, $holder, $ret_percent, $surv_ben, $work_sch_code, $cont_amt, $cont_code, $stuff) = / (\d) # $beginning (\d{4}) # $agency (\d{3}) # $district (\d{9}) # $ssn (\d{2}) # $serv_per_m (\d{2}) # $serv_per_y (\d) # $serv_per_t (\D{10}) # $last_name (\D) # $first_name_i (\D) # $middle_name_i (\d{5}) # $cover_group (\d{2}) # $pay_code (\d{8}) # $pay_rate (\d{6}\D) # $earnings (\s{8}) # $holder (\d{4}) # $ret_percent (\d{3}) # $surv_ben (\d{3}) # $work_sch_code (\d{5}\D) # $cont_amt (\d{2}) # $cont_code (.*\s) # $stuff $ /x ); if ($result == 21) { # Test the variables } else { # This line did not match }

In reply to Re: string error message by markkawika
in thread string error message by sgmansell

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.