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