#!/usr/local/bin/perl

$DEBUG=1;
$city=$ARGV[0];
$stationlist=$city."/STATIONS";

open (STATIONLIST, "$stationlist") || die "can't open $stationlist: $!";

$column=0;
# build 7 blank arrays with every half hour
while (<STATIONLIST>) {
	chop;
	($station,$freq,$web) = split(/:/);
	if (open (STATION, "$city/$station")) {
		while (<STATION>) {
			chop;
			($start,$days,$format,$title) = split(/:/);
			$DEBUG && print "$column $title\n";	
			# fill in array for each applicable day with station, start, show-info
		}	
		$column++;
		close STATION;
	} else {
		print "can't open $station: $!\n";
	}
}

close STATIONLIST;
