Firstly thank you for all your info on my previous query.
I have come accross the Template::Extract module which will make my life a lot easier when extracting data. The module is present, but when I run the following sample code I get the following error:
###########################################################
Can't find string terminator "." anywhere before EOF at Data_Dumper.pl line 17.
###########################################################
#!/usr/bin/perl
# turn on perl's safety features
use strict;
use warnings;
# create a new template extractor
use Template::Extract;
my $extract = Template::Extract->new();
# get the source of the page
use LWP::Simple qw(get);
my $document = get " or die "Can't get page";
# define the template
my $template = << ".";
<a href="city.html?n=[% ... %]">[% city %]
</a></td><td class=r>[% time %]</td>
.
# extract the data
my $data = $extract->extract($template, $document);
# print it out so we can see we've got what we want to
use Data:
umper;
print Dumper $data;
I have come accross the Template::Extract module which will make my life a lot easier when extracting data. The module is present, but when I run the following sample code I get the following error:
###########################################################
Can't find string terminator "." anywhere before EOF at Data_Dumper.pl line 17.
###########################################################
#!/usr/bin/perl
# turn on perl's safety features
use strict;
use warnings;
# create a new template extractor
use Template::Extract;
my $extract = Template::Extract->new();
# get the source of the page
use LWP::Simple qw(get);
my $document = get " or die "Can't get page";
# define the template
my $template = << ".";
<a href="city.html?n=[% ... %]">[% city %]
</a></td><td class=r>[% time %]</td>
.
# extract the data
my $data = $extract->extract($template, $document);
# print it out so we can see we've got what we want to
use Data:
print Dumper $data;