in reply to string error message
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 }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: string error message
by Marshall (Canon) on Jun 16, 2009 at 04:25 UTC | |
by ysth (Canon) on Jun 16, 2009 at 05:59 UTC | |
by Marshall (Canon) on Jun 16, 2009 at 06:20 UTC |