i just didnt know how to use x properly, got a little confused reading the doc.
i added x1 to the format string wherever i wanted to ignore a character
my $count = 0;
foreach my $len (@lens)
{
if ( $count ++ )
{
$format .= "x1";
}
$format .= "A$len";
}