#!/usr/bin/perl -w use strict; my ($title,$actors,$genre,$languages); my (%h,%colours,@a); my $file = "other.txt"; my $nocheck = shift || 0; chdir "$ENV{HOME}/forSale" or die "chdir: $!\n"; open ITEMS, "<$file" or die "open: $file: $!\n"; print <Other items for sale.
Price as indicated, or make me an offer for part/all of any item.
EOH while ( ) { chomp; next if m%^#%; $h{$_}++; } foreach ( sort keys %h ) { @a = split(';',$_); $a[1] = $a[1] ? $a[1] : ' '; my $text = ''; if ( $a[2] ) { foreach ( split(' ',$a[2]) ) { s% %%g; $nocheck || -f $_ or die "$_: Not found\n"; $text .= "$_, "; } } if ( $a[3] ) { $a[0] = "" . $a[0] . ""; } print < EOT } print "
Item Links to pictures Price
$a[0] $text $a[1]
\n";