#!/usr/bin/perl -w use strict; my ($title,$actors,$genre,$languages); my (%h,%colours,@a); my $file = "dvds.txt"; my $html = "DVDsForSale.html"; chdir "$ENV{HOME}/forSale" or die "chir: $!\n"; open DVDs, "<$file" or die "open: $file: $!\n"; print <DVDs for sale.

Prices 15 CHF per DVD, or any 3 for 40 CHF, unless otherwise indicated. All DVDs are European-region. Follow the links for reviews from http://www.imdb.com/.


EOH while ( ) { chomp; next if m%^#%; $h{$_}++; } foreach ( sort keys %h ) { @a = split(';',$_); $a[4] = $a[4] ? $a[4] : ' '; if ( $a[5] ) { $a[2] =~ s% %%g; $a[0] = "" . $a[0] . ""; } print < EOT } print "
Titre/Title Starring... Style/Genre Languages Price (if not 15 CHF)
$a[0] $a[1] $a[2] $a[3] $a[4]
\n";