Check out http://www.perlmonks.org/?node_id=438189 (it has nice line-wrapping snippet).