Last active
September 3, 2015 21:44
-
-
Save bbkr/4930c5bb9abaa2211756 to your computer and use it in GitHub Desktop.
Curl Easy NativeCall
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use NativeCall; | |
class Curl::Easy is repr( 'CPointer' ) { | |
sub curl_easy_init ( ) returns Curl::Easy is native( 'libcurl' ) { * }; | |
sub curl_easy_cleanup ( Curl::Easy ) is native( 'libcurl' ) { * }; | |
method new ( ) { | |
curl_easy_init(); | |
} | |
submethod DESTROY { | |
say 'destroying'; | |
curl_easy_cleanup( self ); | |
} | |
}; | |
loop { Curl::Easy.new }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment