Process arguments and open source file

Previous: Write index page ] [ Top: xmlp alpha ] [ Next: Clean up afterwards ]

Finally, now that we have the good stuff out of the way, we're ready to talk about how we open our input file. The scan and weave steps expect input in the INPUT file handle.
 
if (@ARGV != 1) {
   print STDERR "Usage: $0 <filename>\n";
   exit 1;
}
open INPUT, $ARGV[0] or die "Can't open file '$ARGV[0]'\n";

$format_html = $ARGV[0];
$format_html =~ s/\.xml$/_format.html/i;
$index_html = $ARGV[0];
$index_html =~ s/\.xml$/_index.html/i;
And after all is said and done, we'll want to clean all this up, too.
  Add the following to "Clean up afterwards"
close INPUT;
Previous: Write index page ] [ Top: xmlp alpha ] [ Next: Clean up afterwards ]


This code and documentation are released under the terms of the GNU license. They are additionally copyright (c) 2000, Vivtek. All rights reserved except those explicitly granted under the terms of the GNU license.