in reply to Re: Parsing Values from a Flat File?
in thread Parsing Values from a Flat File?

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"