#!/usr/bin/perl # # Read the .txt files, and generate HTML for the # photo and caption. die "argument required" unless $ARGV[0]; $dirname = $ARGV[0]; $dirname =~ s:/[^/]+$::; # Obtain the caption. open(INPUT, "$dirname/caption.txt") || die "$dirname/caption.txt: $!"; $caption = ; $caption =~ s/\r//g; chop $caption; # Output the stock HTML. open(OUTPUT, ">$ARGV[0]") || die "$ARGV[0]: $!"; print OUTPUT <<"EOM"; $caption

$caption

EOM exit 0;