#!/usr/bin/perl -w use strict; my $match; while (<>) { chomp; if (/href=\"(.*)\"/i) { $match = $1; $match =~ s/ .*$//g; $match =~ s/\"//g; print "$match\n"; } } exit(0);