#! /usr/bin/perl -w

$cmd = 'wget -q -O - http://home.thep.lu.se/~mattias/index.html';
open $INPIPE, '-|', $cmd;
open $OUTPIPE, '|-', 'sort|uniq';
while ( <$INPIPE> ) {
   while ( /(href|HREF)="([^"]+)"/g ) {
      print $OUTPIPE "$2\n";
   }
}
close $INPIPE;
close $OUTPIPE;
