Is there a way to extract HTML page title using Perl? I know it can be passed as a hidden variable during form submit and then retrieved in Perl that way but I was wondering if there is a way to do this without the submit?
Like, lets say i have an HTML page like this:
<html><head><title>TEST</title></head></html>
and then in Perl I want to do :
$q -> h1('something');
How can I replace ‘something’ dynamically with what is contained in <title> tags?
I would use pQuery. It works just like jQuery.
You can say:
Replacing stuff is similar:
You can pass an HTML string to the
pQueryconstructor, which it sounds like you want to do.Finally, if you want to use arbitrary HTML as a ‘template’, and then ‘refine’ that with Perl commands, you want to use Template::Refine.