use Web::Magic -sub => 'web';
# Paste to paste2.org, and say the URL it was pasted to
code => 'say "Hello world";',
lang => 'perl',
description => 'Perl Hello World',
parent => 0,
submit => 'Submit',
HTML::Query, Web::Query, Web::Scraper, Web::Magic ... a lot of the same kind of work, which horse to choose?
Sell me a horse?
Selecting stuff via CSS selectors is only a very small part of what Web::Magic does. (I almost regret using that feature in my first example.) Web::Magic aims to be the swiss army knife of HTTP-addressable resources. Whether it's a classic web page, a RESTful API, an Atom feed, or a WebDAV fileshare, Web::Magic can probably make dealing with it easier.
Let's suppose you have a RESTful API which supports up XML and JSON, depending on the request's HTTP Accept header. Web::Magic notices how you're trying to access the data, and does what you mean...