#!/usr/bin/perl use strict; my ($link, $title, $descr); my $count = 1; my $found = 0; my @lines = <>; print '', "\n"; print '', "\n"; print '', "\n"; print '', "\n"; print ' Repubblica - Ultimora', "\n"; print ' http://www.repubblica.it/news/ired/ultimora/altre_n.html', "\n"; print ' Ultime notizie', "\n"; print ' it', "\n"; foreach ( @lines ) { s/&([aeiou])grave;/\1\`/gi; s/&([aeiou])acute;/\1\'/gi; if ( m/foglietti3\.gif/ ) { $found = 1; next; } if ( (m/href=\"(.*)\".*\(.*)\<\/b\>/) && $found == 1 ) { $link = $1; $title = $2; $found++; next; } if ( (m/\(.*)\<\/td/) && $found == 2) { $descr = $1; $found++; next; } if ( $found == 3 ) { print '', "\n"; print ' ', $title, '', "\n"; print ' http://www.repubblica.it/', $link, '', "\n"; print ' ',$descr, '', "\n"; print '', "\n"; last if ( $count == 20 ); $count++; $found = 0; } } print '', "\n"; print '', "\n";