in reply to Maintainable code is the best code Part II
but
although you can make an array slice out of unpack's results, you can also use a LHS undef for padding in these situations :
my $line="partnum partdesc color flavor "; my ($part, $desc, undef, $flava)= unpack "A10A10A10A10", $line; print "--\n$part\n$desc\n$flava\n--";
which I find easy to parse.
|
|---|