use strict; use warnings; use v5.10; use URI; my $link = 'http://www.EXAMPLE.com'; my $u = URI->new($link); say $u->canonical; # http://www.example.com/