#!/usr/bin/env perl use strict; use warnings; use LWP::UserAgent; use POE::Filter::Line; my $filter = POE::Filter::Line->new; my $ua = LWP::UserAgent->new; ## POE::Filter::Line で $chunk を行入力に変換 $ua->get( 'http://d.hatena.ne.jp/naoya/', ':content_cb' => sub { my $chunk = shift; my $lines = $filter->get([ $chunk ]); for (@$lines) { print "got: $_\n"; } } ); POE::Filter は単独で使うことができます。LWP のコールバックと組み合わ