Perl Diver 2.33
Main Environment Variables Perl Default Values Perl Config - Summary Perl Config - Full Installed Modules List Directory uptime Docs

Module Documentation
Details and documentation about a specific module, including version and documentation (if available). Note that while links to perldoc.com and search.cpan.org are provided, the module may be part of a larger distribution. If you reach a File Not Found page on either site, please try the parent module.

URI::Title

Name URI::Title
Version 1.902
Located at /usr/share/perl5
File /usr/share/perl5/URI/Title.pm
Is Core No
Search CPAN for this module URI::Title
Documentation URI::Title
Module Details URI::Title

NAME

URI::Title - get the titles of things on the web in a sensible way


VERSION

version 1.902


SYNOPSIS

  use URI::Title qw( title );
  my $title = title('http://microsoft.com');
  print "Title is $title\n";


DESCRIPTION

I keep having to find the title of things on the web. This seems like a really simple request, just get() the object, parse for a title tag, you're done. Ha, I wish. There are several problems with this approach:

What if the resource is on a very slow server? Do we wait for ever or what?
What if the resource is a 900 gig file? You don't want to download that.
What if the page title isn't in a title tag, but is buried in the HTML somewhere?
What if the resource is an MP3 file, or a word document or something?
...

So, let's solve these issues once.


METHODS

only one, the title(url) method. Call it with an url, get the title if possible, undef if it wasn't. Very simple.


TODO

Many, many, many things. Still unimplemented:

Get titles of MP3 files, Word Docs, PDFs, etc.
Configurable.. well, anything, in fact. Timeout would be a good start.
Better error reporting.


AUTHORS

Tom Insam <tom@jerakeen.org>, original author, 2004-2012.

Philippe Bruhat (BooK) <book@cpan.org>, maintainer, 2014.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


CREDITS

Invented because of a conversation with rjp, who contributed some eyeball-melting and as-yet-unused code to get titles from MP3s and PDFs, and hex, who has also solved the problem, and got bits done in a nicer way than I did.

Perl Diver brought to you by ScriptSolutions.com © 1997- 2026