/[A3C]/bin/towns.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /bin/towns.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 80 - (hide annotations)
Fri Apr 11 23:24:59 2008 UTC (15 years, 11 months ago) by dpavlin
File MIME type: text/plain
File size: 542 byte(s)
added Town model with data
1 dpavlin 80 #!/usr/bin/perl
2    
3     use warnings;
4     use strict;
5    
6     use lib 'lib';
7    
8     use Jifty;
9     use Data::Dump qw/dump/;
10    
11     BEGIN { Jifty->new; };
12     Jifty->web->request(Jifty::Request->new);
13     Jifty->web->response(Jifty::Response->new);
14    
15     my $data_file = 'data/gradovi.txt';
16    
17     my $town = A3C::Model::Town->new;
18    
19     open(my $fh, '<', $data_file ) or die "can't open $data_file: $!";
20     while(<$fh>) {
21     chomp;
22     my @d = split(/;/,$_,3);
23     my ($id,$msg) = $town->load_or_create(
24     name => $d[0],
25     municipality => $d[1],
26     county => $d[2],
27     );
28    
29     warn "$id ", $d[0], $msg || '', "\n";
30     }

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26