my $new_url = ''; eval{ my $u = URI->new_abs($link_string, $last_url); $new_url = $u->canonical; }; if($@){ $self->log_message("clean_link Error: $@", 20); return undef; } return undef unless(length($new_url)); $new_url =~ s!\.\./!!g; $new_url =~ s!\./!!g; $new_url =~ s!//$!/!g;