in reply to Re: Abritrary multiple spaces as delimiter
in thread Abritrary multiple spaces as delimiter

You're slurping the padding into the values.. do you really want to? Also, a few more spaces help make things pleasing to the eye:

my ($num, $title, $author, $flag1, $flag2) = unpack "A7 x1 A27 x1 A25 x1 A1 x5 A1", $str;
Actually I'd probably write a simple subroutine such that I could say
unpack_fields( $str, \my $num => 7, padding => 1, \my $title => 27, padding => 1, \my $author => 25, padding => 1, \my $flag1 => 1, padding => 5, \my $flag2 => 1, );

This also clearly documents the data format.

Update: see Yet another unpack wrapper: flatfile databases with fixed width fields.

Makeshifts last the longest.