#!/App/Perl/bin/perl -w # # map_gen.pl # # Perl script to generate a map grid database file. # # (c) Copyright 2000 by Clint Goss, All Rights Reserved. use strict 'vars'; # Pick up our options use Getopt::Std; use vars qw($opt_d $opt_D $opt_f $opt_h); if (! getopts("f:dDh")) { &usage(); exit; } sub usage { print <$mapGridFilename") || die "Can't open $mapGridFilename: $!"; # Standard sizes in the file. my ($headerByteCount) = 10; my ($bytesPerFileName) = 20; # Populate the file names my (@rowNames) = qw(m n o p q r); my (@colNames) = qw(0 1 2 3 4 5 6 7 8 9 a); my ($rowCount) = scalar @rowNames; my ($colCount) = scalar @colNames; # Write the row count and the column count seek (MAP_GRID, 0, 0); print MAP_GRID pack("cc", $rowCount, $colCount); # Write each of the file names into the database file my ($row, $col); foreach $row (0 .. $rowCount-1) { foreach $col (0 .. $colCount-1) { seek (MAP_GRID, $headerByteCount + (($row*$colCount) + $col) * $bytesPerFileName, 0); print MAP_GRID pack ("A20", $rowNames[$row] . $colNames[$col] . ".jpg"); } } close MAP_GRID; exit;