my $text; while () { if ($_ =~ /^.* src=([^>]*)>.*$/ixg) { $text .= "$1\n"; } }