Script file structure

Previous: index ] [ Top: xmlp alpha ] [ Next: Initial scan ]

This is the overall layout of the file, and indeed of most single-file Perl scripts. As such, it will serve as a useful pattern someday when this project gets to the point where patterns are explicitly supported.

I don't know how other people write Perl scripts, but I start out by processing the input, so I can quit early if there's already a problem. Then globals and subroutine declaration (in most of my larger pieces, of course, I eschew globals and I put subroutines into separate files.) Then the meat of the code, which executes the following basic algorithm:

 
#!/usr/local/bin/perl
# This is the XMLP alpha Perl script.
# Copyright (c) 2000 Vivtek.  All rights reserved except those explicitly granted
# under the GNU Public License.
# http://www.vivtek.com/xmlp/xmlp_alpha/index.html for more information.

See Process arguments and open source file


See Initial scan
See Tangle: write code output
See Write index page
See Weave: Write documentation pages

See Clean up afterwards
Previous: index ] [ Top: xmlp alpha ] [ Next: Initial scan ]


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.