in reply to Need to build attribute parser

Here's a simple parser for you:
$/ = "\n-"; open INPUT, "lp.attr" or die "... $!"; # or whatever while (<INPUT>) { chomp; my ($name,$attr) = split /\s*:\s*/, $_, 2; $name = "-$name" if $. != 1; # the first record has a - my @attrs = split /,\s+/, $attr; $CONFIG{$name} = (@attrs == 1) ? $attrs[0] : \@attrs; } close INPUT;
This would create a hash, %CONFIG, where the keys are strings like '-input-trays-supported' or '-descriptor', and the values are either strings, or references to an array of strings: $CONFIG{'-input-trays-supported'} is [ 'top', 'middle', 'bottom', ... ], and $CONFIG{-descriptor} is 'hp5si PS TCP Template'.

$_="goto+F.print+chop;\n=yhpaj";F1:eval