$inx = '.inx'; $var = '.html'; $html = '.htm'; $body = '.body'; $doctype = ''; $head = ''. ''; $author = 'Jukka K. Korpela'; $indexname{'fi'} = 'Tekniikoita monikielisiä Web-sivustoja varten'; $indexname{'en'} = 'Techniques for multilingual Web sites'; $indexname{'sv'} = 'Tekniker för mångspråkiga Webbsajter'; $indexname{'de'} = 'Techniken für mehrsprachige Web-Sites'; $indexname{'ru'} = 'Метды для многоязычных
узлов Web'; ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime(time); $timestamp = sprintf "%4d-%02d-%02d", 1900+$year,$mon+1,$mday; for(;;) { print "Section name: "; $name = <>; chomp $name; last if open(INDEX,"<$name".$inx); print "Not found, please try again.\n"; } open(VAR,">$name".$var) || die "Can't create var file $!"; while() { ($lang, $title) = split(':'); chomp $title; $assoc{$lang} = $title; } close INDEX; sub byname { $name{$a} cmp $name{$b} } print "Variants:"; foreach $variant (sort byname keys(%assoc)) { print " $variant"; $varuri = "$name-$variant$html"; print VAR "URI: $varuri\n"; print VAR "Content-Type: text/html\n"; print VAR "Content-Language: $variant\n"; print VAR "Description: $assoc{$variant}\n\n"; open(VARIANT,">$varuri") || die "Can't create $variant file $!"; print VARIANT "$doctype\n"; print VARIANT "\n"; print VARIANT "\n$assoc{$variant}\n"; print VARIANT "$head\n"; print VARIANT "\n

$indexname{$variant}:"; print VARIANT "
$assoc{$variant}

\n"; open(BODY,"<$name-$variant$body") || die "Can't open body for $variant $!"; while() { print VARIANT $_; } close BODY; print VARIANT "
\n"; print VARIANT '\n"; print VARIANT "

$timestamp $author

\n"; print VARIANT "\n\n"; close VARIANT; } close VAR; print "\n(Done)\n";