I think you can do:
$page =~ m|<title>(.+?)</title>|i and $title = $1;
Instead of looping twice.
If you were to loop you'd want a last; in there after you found the title.
Code:
my $page = get($url); $page =~ m|<title>(.+?)</title>|i and $title = $1;
Instead of looping twice.
If you were to loop you'd want a last; in there after you found the title.