> The second loop is executing.  The TEST statement worked.

Ok.

> The Currency part of the email has a fixed format that is never
> deviated from:
> 
> 1-3 $cur_sym
> 4 space
> 5-32 $cur_desc
> 33-35 (3) spaces
> 36-55 d8.d10 (00000000.0000000000)
> 56-58 (3) spaces
> 59-78 d8.d10 (00000000.0000000000)

This doesn't precisely match your example:

> >     USD United States Dollars                 1.00000
> > 1.00000

This includes numbers that are space padded in front
and have just five zeroes after the decimal point (no
doubt also space padded for the remaining decimal
places).

> I tried to shorten it to match the $cur_sym only

Good move.

> but couldn't get it to work

Bummer.

> I also tried the following: 
> ($cur_sym, $cur_desc, $usd_unit, $units_usd) =
> /^([A-Z]{3}) ([A-Za-z]{28})   (\d{7}\.\d{10})   (\d{7}\.\d{10})\s*$/;

\d matches a digit. In your example, there are spaces
where the above regex expects digits.

Are you sure my original currency line regex isn't matching?

If you are still doing the print-after-the-loop-ends
thing, then the variables will naturally be empty,
because the loop ends when the regex fails
to match, hence setting all the variables to null
just before it exits the loop.

Going back to your attempt to get $cur_sym to 
match, try this as the first statements inside the
second loop:

    ($cur_sym) = /^([A-Z]{3})/;
    print $cur_sym;

does that do anything?

Reply via email to