This file contains hidden or 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
| #!/usr/bin/env perl | |
| use strict; | |
| use warnings; | |
| use feature ':5.10'; | |
| use URI::Escape; | |
| sub xx { | |
| uri_unescape( |
This file contains hidden or 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
| #!/usr/bin/env perl | |
| use strict; | |
| use warnings; | |
| use feature ':5.10'; | |
| use Guard; | |
| sub unwind_protect(&@){ | |
| my $code = shift; |
This file contains hidden or 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 strict; | |
| use warnings; | |
| use feature ':5.10'; | |
| # this is a test |
This file contains hidden or 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
| has 'breadboard' => ( | |
| is => 'ro', | |
| isa => 'Bread::Board::Container', | |
| handles => ['fetch'], | |
| builder => '_build_breadboard', | |
| ); | |
| sub _build_breadboard { | |
| my $self = shift; |
This file contains hidden or 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
| #include <EXTERN.h> | |
| #include <perl.h> | |
| #include <stdlib.h> | |
| #include <stdio.h> | |
| PerlInterpreter *my_perl; | |
| inline SV *run_in(PerlInterpreter *perl, char *code){ | |
| SV *result; | |
| my_perl = perl; |
This file contains hidden or 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 strict; | |
| use warnings; | |
| use Test::More; | |
| BEGIN { use_ok 'Eval::Clean' }; | |
| use JSON; | |
| my $perl = Eval::Clean::new_perl(); | |
| ok $perl, 'got a new perl'; |
This file contains hidden or 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
| #!/usr/bin/env perl | |
| use strict; | |
| use warnings; | |
| use feature ':5.10'; | |
| use AnyEvent::HTTP; | |
| my $cv = AE::cv; | |
| http_get 'http://www.google.com/', $cv; |
This file contains hidden or 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 strict; | |
| use 5.010; | |
| { package Class; | |
| sub new { my $self = bless $_[1], $_[0]; warn $self; $self } | |
| sub DESTROY { warn $_[0] } | |
| } | |
| # works | |
| { |
This file contains hidden or 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
| #include <errno.h> | |
| #include <netinet/in.h> | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| #include <sys/socket.h> | |
| #include <sys/time.h> | |
| #include <sys/types.h> | |
| #include <time.h> |
This file contains hidden or 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
| function EventListener() {} | |
| EventListener.prototype.listen_to = function (that) { | |
| for (var key in this) { | |
| var event; | |
| if(event = /^handle_(.+)$/.exec(key)){ | |
| var method = [this, this[event[0]]]; | |
| that.on( event[1], function() { | |
| method[1].apply(method[0], arguments); | |
| }); |