in reply to Parsing Values from a Flat File?

batcater98:

I have done this before, but having troubles with the different seperators in this one.
Since your lines are fixed-format, you could use substr to break the line apart.

...roboticus

Replies are listed 'Best First'.
Re^2: Parsing Values from a Flat File?
by wardy3 (Scribe) on Feb 22, 2008 at 04:33 UTC

    unpack too

    One of my favourites and often more readable.

    For example:

    my ( $flag, $value ) = unpack 'A A2', $flag_entry;

    This will split $flag_entry into a 1-char field followed by a 2-char field. If $flag_entry is C13, then $flag will get "C" and $value will get "13"