This is sample code to demonstrate how you can do it. The code will create captcha.jpg file in the programs directory so you can check it and input CAPTCHA after that:
use strict;
use warnings;
use FindBin qw($Bin);
#use HTML::TreeBuilder::XPath;
use WWW::Mechanize;
my $mech = WWW::Mechanize->new();
$mech->agent_alias("Windows IE 6");
$mech->get(
"http://epaper.dfdaily.com/dfzb/page/1/2013-08/17/A01/20130817A01_pdf.pdf");
#you don't need commented code
#because CAPTCHA URL is always the same for this site
#my $tree = HTML::TreeBuilder->new_from_content( $mech->content() );
#my ($src) = $tree->findvalues('//img[@id="checkcode"]');
$mech->get("http://203.156.244.168:9000/validatecodegen");
open my $fh, ">:raw", "$Bin/captcha.jpg" or die $!;
print {$fh} $mech->content();
close $fh;
$mech->back();
print "Input CAPTCHA: ";
my $code = <>;
chomp $code;
$mech->submit_form(
with_fields => {
checkCode => $code,
},
button => "Submit",
);
$mech->save_content("$Bin/result.pdf");