You just need to emulate JavaScript in your script. I used Firefox's HTTPFox extension to find what info you need to POST:
use WWW::Mechanize;
my $url="http://mops.twse.com.tw/mops/web/t05st03";
my $co_id = 1101;
my $mech = WWW::Mechanize->new();
$mech->agent_alias("Windows IE 6");
$mech->get($url);
$mech->post("http://mops.twse.com.tw/mops/web/ajax_t05st03",
Content => {
encodeURIComponent => 1,
step => 1,
firstin => 1,
off => 1,
keyword4 => "",
code1 => "",
TYPEK2 => "",
checkbtn => "",
queryName => "co_id",
TYPEK => "all",
co_id => $co_id,
});
my $response;
$response = $mech->content();