]> git.datanom.net - webcal.git/blame - install/tz.pl
Initial upload
[webcal.git] / install / tz.pl
CommitLineData
a5eae6b7
MR
1#!/usr/bin/env perl
2use strict;
3use warnings;
4my ($tz, @zones);
5
6open FILE, "timezone.txt" or die $!;
7while (<FILE>) {
8 if ($_ =~ /"(\w*\/?\w*)"/) {
9 push @zones, $1;
10 }
11}
12close FILE;
13
14my $size = scalar @zones;
15$tz = "<?php\n\$timezone = array(\n";
16foreach (@zones) {
17 $size--;
18 $tz .= "\t\"$_\"";
19 $tz .= ($size) ? ",\n" : "\n";
20}
21$tz .= ");\n?>\n";
22
23open FILE, ">timezone.php" or die $!;
24print FILE $tz;
25
26exit 0;
This page took 0.029838 seconds and 5 git commands to generate.