#! /usr/bin/perl use strict; use warnings; use URI; my $uri = URI->new("dvb://tv.mydomain.com:11300/rsat.ts"); if ( !$uri->can('host') ) { # treat it like a http scheme, save the old one my $scheme = $uri->scheme('http'); print $uri->host; # restore old scheme $uri->scheme($scheme); } __END__