in reply to RFC: Text::FixedWidth

I will find it very useful and would like to have it, if you do two things:

  1. Allow me to specify file format through XML, not coding.
  2. Provide a simpler interface than those existing modules. All what I expect is really simple - be able to parse the file automatically into certain data structure, don't make it too complex. Excessive functionality is not always better, and might easily break modulization.

Replies are listed 'Best First'.
Re^2: RFC: Text::FixedWidth
by runrig (Abbot) on Jul 26, 2005 at 22:07 UTC
    Allow me to specify file format through XML, not coding.

    You mean something like:

    use XML::Simple; use Parse::FixedLength; my $x = XMLin(<<XMLEND); <format> <field> <fname>fld1</fname> <length>10</length> </field> <field> <fname>fld2</fname> <length>20</length> </field> <field> <fname>fld3</fname> <length>30</length> </field> </format> XMLEND my $fmt = [ map { "$_->{fname}:$_->{length}" } @{$x->{field}} ]; my $p = Parse::FixedLength->new($fmt);

    Somehow I doubt you mean this, but you gotta start somewhere...(and I'm not clear on how XML makes this any better)