use strict; use vars qw(%PROP %SET %SET_ALIAS $VERSION); $VERSION=do{my @r=(q$Revision: 1.2 $=~/\d+/g);sprintf "%d."."%02d" x $#r,@r}; $PROP{module_name} = 'FooScript'; sub header () { <<"EOH"; ## This is auto-generated (at @{[ sprintf '%04d-%02d-%02dT%02d:%02d:%02dZ', (gmtime)[5]+1900, (gmtime)[4]+1, (gmtime)[3,2,1,0] ]}). Do not edit by hand! use strict; package Char::InSet::$PROP{module_name}; use Exporter; use vars qw(\@EXPORT_OK \@ISA \$VERSION); \@ISA = qw(Exporter); \$VERSION = '$PROP{version}'; EOH } sub table () { my $r = ''; my @set; for (sort keys %SET) { my (@aline,@aitem); $SET{$_} =~ s{^#\+(\w+)$}{ push @aline, qq(\&In$PROP{module_name}$1.); '' }mge; $SET{$_} =~ s{^!(.+)$}{ ## Pre-formated push @aitem, $1; '' }mge; $SET{$_} =~ s{^#.+$}{}mg; $SET{$_} =~ tr/\x09\x0A\x0D\x20//d; push @set, [qq(In$PROP{module_name}$_) => join "\n", qq(sub In$PROP{module_name}$_ {), @aline, (length $SET{$_}? (q(< $b} map {ord $_} split //, $SET{$_}), q(EOH)): @aitem > 0? (q(< qq(\*In$PROP{module_name}$_ = \\&In$PROP{module_name}$SET_ALIAS{$_};)]; } $r = qq(\@EXPORT_OK = qw(@{[map {$_->[0]} @set]});\n\n); $r .= join '', map {$_->[1]."\n\n"} @set; $r; } sub footer () { my $r = < regexps @{[$PROP{pod_description}? "=head1 DESCRIPTION $PROP{pod_description}":'']}@{[$PROP{pod_example}? "=head1 EXAMPLE $PROP{pod_example}":'']}@{[$PROP{pod_license}? "=head1 LICENSE $PROP{pod_license}":"=head1 LICENSE Copyright @{[(gmtime)[5]+1900]} $PROP{author_name} <$PROP{author_mail}> This library and the library generated by it is free software; you can redistribute them and/or modify them under the same terms as Perl itself. "]}@{[$PROP{pod_see_also}? "=head1 SEE ALSO $PROP{pod_see_also}":'']} =cut 1; ### $PROP{module_name}.pm ends here EOH $r; } sub print_module () { no warnings; print &header.&table.&footer; } =head1 NAME mkpm.pl --- Char::InSet::Han modules generating library =head1 LICENSE Copyright 2002 Wakaba This library and the library generated by it is free software; you can redistribute them and/or modify them under the same terms as Perl itself. =cut 1; ## $Date: 2002/08/23 23:16:32 $ ### mkpm.pl ends here