#!/usr/bin/perl use CGI::Pretty qw( :html3 ); use DBI; use strict; use CGI qw/:standard/; #my $dbiuid = 'uid'; #my $dbipwd = 'pwd'; #my $dbh = DBI->connect( 'DBI:mysql:housing;host=localhost', $dbiuid, $dbipwd ) || die "Could not connect to database: $DBI::errstr"; my $file = 'ss.txt'; my $line=0; print header, start_html('SS'); open (FILE, $file) or die "Can't open $file: $!\n"; while(){ next if /^(\s)*$/; chomp; $line++; if($line == 1){ my(undef,$lot,$date) = split(/\s+/, $_); $date =~ s/\n//; print "$lot $date
"; next; } if($line == 2){ my $lien = $_; print "$lien
"; next; } if($line == 3){ my $owner = $_; print "$owner
"; next; } if($line == 4){ my $address = $_; my $city = $address; $city =~ /(\w+)$/; my $test = $1; print "$address - $test
\n"; next; } if($line == 5){ my $price = $_; $price =~ s/\$//; $price =~ s/,//g; print "$price
\n"; $line=0; next; } }