Subject: | method "squid_hosts" does not exists |
Greetings,
I believe I found a bug in your module. I just installed the module,
made the configuration in Squid, but when I tried to execute the Perl
script I received an error message saying that the "squid_hosts" methods
does not exists.
Looking at this part of the code (just the interesting part of HTTP.pm):
Net::Squid::Purge::HTTP->mk_accessors(qw(squid_servers));
sub purge {
my ($self, @urls) = @_;
if (! $self->squid_servers) { die 'squid_servers must be set!'; }
for my $squid_host (@{$self->squid_hosts})
Since only "squid_servers" is declared as an attribute/accessor, the
code is not able to use $self->squid_hosts. I changed the code replacing
"squid_hosts" with "squid_servers" and it worked fine. Unfornately I
made this in a rush and I don't have an patch to send you right now
(sorry). UDP.pm seems to suffer from the same issues.
I would like also to suggest some changes in the interface, specially
making the attributes fixed (using Hash::Util module) and making the
purge method as a new method in Purge.pm, since HTTP.pm and UDP.pm have
a very similar operation, since just the connection is different (an
interface could be build using a Connection object, for example, and
making obligatory for both modules that inherints from Purge.pm to
overwrite it.
Tested on a Perl version is 5.8.3 running in a Conectiva Linux 10.
My best regards,
Alceu