Subject: | Try::Tiny::try swallows @_ in both Scrappy::Scraper::form and Scrappy::Scraper::post ! |
In the "CAVEATS" section of "Try::Tiny" POD, the first one states:
@_ is not available within the try block, so you need to copy your
arglist. In case you want to work with argument values directly via @_
aliasing (i.e. allow $_[1] = "foo"), you need to pass @_ by reference
So a quick-and-dirty fix might be:
--- lib/Scrappy/Scraper.pm
+++ lib/Scrappy/Scraper.pm
@@ -274,8 +274,9 @@
# set html response
$self->content('');
+ my $args = \@_;
try {
- $self->content($self->worker->submit_form(@_));
+ $self->content($self->worker->submit_form(@{$args}));
};
if ($self->content) {
@@ -629,8 +630,9 @@
# set html response
$self->content('');
+ my $args = \@_;
try {
- $self->content($self->worker->post(@_));
+ $self->content($self->worker->post(@{$args}));
};
if ($self->content) {
Such that would prevent Try::Tiny::try from swallowing @_ in both
Scrappy::Scraper::form and Scrappy::Scraper::post ;-)
Some lines from 'perl -v':
This is perl 5, version 12, subversion 3 (v5.12.3) built for MSWin32-
x86-multi-thread
Binary build 1204 [294330] provided by ActiveState
http://www.ActiveState.com
Built Feb 9 2011 14:38:22