use URI::URL; my $b = new URI::URL('httPs://foo.bar.com/baz?brd#red'); print "$b must be accessed using https " if $b->scheme eq 'https'; __END__ https://foo.bar.com/baz?brd#red must be accessed using https