#!/usr/bin/env perl # # $FML: data2sgml.pl,v 1.2 2002/04/01 23:41:08 fukachan Exp $ # use strict; use Carp; use vars qw(%list @ENTRY); @ENTRY = ('system', 'release', 'perl.version', 'perl.path', 'comments' ); my ($system, $release, $key, $value); my $in_row = 0; while (<>) { if (/^\s*$/) { if ( $list{ 'title' } ) { table_head(\%list, $list{'title'} ); } elsif (%list) { show_row(); show_list(\%list); } undef %list; } if (/^\[(\S+)\]\s+(.*)/) { ($key, $value) = ($1, $2); $list{ $key } .= $value; } } print "\t\n"; print " \n"; print " \n"; print "\n"; exit 0; sub table_head { my ($list, $title) = @_; my $cols = length(@ENTRY); print "