What\'s the best way to read a fixed length record in Perl. I know to read a file like:
ABCDE 302
DEFGC 876
I can do
while
Regardless of whether your records and fields are fixed-length, if the fields are separated by uniform delimiters (such as a space or comma), you can use the split function more easily than unpack.
my ($field1, $field2) = split / /;
Look up the documentation for split. There are useful variations on the argument list and on the format of the delimiter pattern.