<!-- thumbnail: https://i.sstatic.net/MZZDh.png -->
<!-- version: 0.05 -->
<!-- tag: perl -->
<!-- excerpt: A simple Perl wrapper for StackExchange API. Supports all methods including filters. The project is open source and is on CPAN -->

##About

This library is a little labour of love for two things dear to me : **StackOverflow**, a place where I've learned just so much, and **Perl** a cryptic language that's giving me perspective. I happen to be a long time C# developer so the whole thing was a -*learn a language by building stuff*- exercise. Any feedback and kind-insults are welcome. Please file them as issues on the github repository.


##Examples

The API is designed to be a one to one mapping with the methods in the documentation. It also has some conventions to make the interface intuitive. See the [documentation on metacpan][1], I've written examples and some design notes. 

    use Net::StackExchange2;
    #For read-only methods.
    my $se = Net::StackExchange2->new({site => 'stackoverflow'});
     
    #OR
     
    #for methods that require auth.
    my $se = Net::StackExchange2->new(
        {site=>"stackoverflow", 
         access_token => '<THE ACCESS TOKEN>', 
         key => '<YOUR APP KEY>'
        }
    );
     
    my $ret =  $se->answers->answers_all({ order=> "desc", sort=>"votes" });
    my $ret = $se->answers->answers(14586834);#pass one single ID
    #or pass many in an array ref
    my $ret = $se->answers->answers([4449779, 4477003]);
     
    my $ret  = $se->search->search({tagged=>"perl"});
     
    my $ret = $se->tags->tags_top_askers("perl", "month");
     
    #filters are also supported. 
     
    #This method gets comments from one user to another 
    #and only retrives the body of the comment
    my $ret = $se->users->
           users_comments_toid(368070,22656, {filter => '!mRNaB_KjjP'});

###License

The library is licensed under the Bsd 3-clause. See [this for a quick english TL:DR][2] about it.

###Download

Ideally you don't need to download anything to use it with perl. [It's on CPAN here][3]. You just install it with cpan. Note it's **Net:StackExchange2** (2 at the end). _Net:StackExchange_ is an older distribution for the 1.x API.


    sudo cpan
    >install Net::StackExchange2

##Contact

Contact me at *gideon [at] cpan [dot] org* for any issues with this distribution.

##Code

All of it is written in perl of course. Since I'm a beginner it might not be the best perl you've seen, I would be very happy to hear **any** suggestions/feedback.

The project is on github here: https://github.com/gideondsouza/perl-net-stackexchange

Please file any issues/bugs/features on the github page.

##Road Map

* Write some test cases.
* Implement better core abstractions with a test seam, so I can write unit tests to see whether each method generates the right url.

  [1]: https://metacpan.org/module/Net::StackExchange2
  [2]: http://www.tldrlegal.com/license/bsd-3-clause-license-%28revised%29
  [3]: https://metacpan.org/module/Net::StackExchange2