in reply to WWW::Mechanize reading HTML

Relative to current work dir:

use URI::file qw( ); my $url = URI::file->new_abs("webpage.html");

Relative to script dir (assuming you didn't change work directory):

use Cwd qw( realpath ); use URI::file qw( ); my $url = URI::file->new("webpage.html")->abs(realpath($0));