bash-2.05b$ cat xml2sgml.pl #!/usr/bin/perl -w use strict; my $doctypePat = quotemeta ( '; print $fl if $fl !~ /^\<\?xml/; while(<>) { if (/$doctypePat/) { print < ]> EOT <>; next; } s/article/book/g; if ( /\<\/bookinfo>/ ) { print $_; print "
\n"; next; } if ( /\<\/book>/ ) { print "
\n"; print $_; next; } print $_; }