use URI::Escape; my $filename = URI::Escape::uri_escape( $link->url_abs->path );