PerlX::QuoteOperator::URL - Quote-like operator returning http request for the URL provided.


PerlX-QuoteOperator documentation Contained in the PerlX-QuoteOperator distribution.

Index


Code Index:

NAME

Top

PerlX::QuoteOperator::URL - Quote-like operator returning http request for the URL provided.

VERSION

Top

Version 0.02

SYNOPSIS

Top

    use PerlX::QuoteOperator::URL;

    my $content = qURL( http://transfixedbutnotdead.com );   # does HTTP request




DESCRIPTION

Top

For more info see PerlX::QuoteOperator.

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."




EXPORT

Top

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';




FUNCTIONS

Top

import

Standard import subroutine.

SEE ALSO

Top

* PerlX::QuoteOperator
* ACME::Url
* http://transfixedbutnotdead.com/2009/12/16/url-develdeclare-and-no-strings-attached/
* http://transfixedbutnotdead.com/2009/12/26/couple-of-cpan-pressies/

AUTHOR

Top

Barry Walsh, <draegtun at cpan.org>

BUGS

Top

Please report any bugs or feature requests to bug-perlx-quoteoperator at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=PerlX-QuoteOperator. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

Top

You can find documentation for this module with the perldoc command.

    perldoc PerlX::QuoteOperator::URL




You can also look for information at:

* RT: CPAN's request tracker

http://rt.cpan.org/NoAuth/Bugs.html?Dist=PerlX-QuoteOperator

* AnnoCPAN: Annotated CPAN documentation

http://annocpan.org/dist/PerlX-QuoteOperator

* CPAN Ratings

http://cpanratings.perl.org/d/PerlX-QuoteOperator

* Search CPAN

http://search.cpan.org/dist/PerlX-QuoteOperator/

ACKNOWLEDGEMENTS

Top

Inspired by this blog post: http://ozmm.org/posts/urls_in_ruby.html and wanting to learn Devel::Declare

DISCLAIMER

Top

This is (near) beta software. I'll strive to make it better each and every day!

However I accept no liability whatsoever should this software do what you expected ;-)

COPYRIGHT & LICENSE

Top


PerlX-QuoteOperator documentation Contained in the PerlX-QuoteOperator distribution.

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__