package PerlX::QuoteOperator::URL; use strict; use warnings; use PerlX::QuoteOperator (); use LWP::Simple (); our $VERSION = '0.02'; sub import { my ($class, $name) = @_; my $caller = caller; my $code = sub ($) { LWP::Simple::get( $_[0] ) }; my $ctx = PerlX::QuoteOperator->new; $ctx->import( $name || 'qURL', { -emulate => 'qq', -with => $code }, $caller ); } 1; __END__ =head1 NAME PerlX::QuoteOperator::URL - Quote-like operator returning http request for the URL provided. =head1 VERSION Version 0.02 =head1 SYNOPSIS use PerlX::QuoteOperator::URL; my $content = qURL( http://transfixedbutnotdead.com ); # does HTTP request =head1 DESCRIPTION For more info see L. For now here is another example: use PerlX::QuoteOperator::URL 'qh'; use JSON qw(decode_json); say decode_json( qh{ http://twitter.com/statuses/show/6592721580.json } )->{text}; # => "He nose the truth." =head1 EXPORT By default 'qURL' is exported to calling package/program. This can be changed by providing a name of your own choice: use PerlX::QuoteOperator::URL 'q_http_request'; =head1 FUNCTIONS =head2 import Standard import subroutine. =head1 SEE ALSO =over 4 =item * L =item * L =item * L =item * L =back =head1 AUTHOR Barry Walsh, C<< >> =head1 BUGS Please report any bugs or feature requests to C, or through the web interface at L. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. =head1 SUPPORT You can find documentation for this module with the perldoc command. perldoc PerlX::QuoteOperator::URL You can also look for information at: =over 4 =item * RT: CPAN's request tracker L =item * AnnoCPAN: Annotated CPAN documentation L =item * CPAN Ratings L =item * Search CPAN L =back =head1 ACKNOWLEDGEMENTS Inspired by this blog post: L and wanting to learn L =head1 DISCLAIMER This is (near) beta software. I'll strive to make it better each and every day! However I accept no liability I should this software do what you expected ;-) =head1 COPYRIGHT & LICENSE Copyright 2009-2010 Barry Walsh (Draegtun Systems Ltd | L), all rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License. See http://dev.perl.org/licenses/ for more information.