#!/usr/bin/perl -- use strict; use warnings; #use open ':locale'; use open ':encoding(UTF-8)'; die "\nUsage: $0 url\n" unless @ARGV; main(@ARGV); sub main { my ($url) = @_; use WWW::Mechanize 1.54; my $ua = WWW::Mechanize->new( agent => "Mozilla/5.0", timeout => 15, ); $ua->get($url); die "Not HTML, it's ", $ua->ct, "\n" unless $ua->is_html(); if ( my $title = $ua->title ) { print "Title: '$title'\n"; } }