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 Data::Dumper; | |
use strict; | |
$a = ['google.ru', on_prepare => sub {}, timeout => 10, sub{}]; | |
print Dumper _extract_known_params($a); | |
print Dumper ($a), "-------\n"; | |
$a = ['google.ru', timeout => 10, on_prepare => sub {}, sub{}]; | |
print Dumper _extract_known_params($a); | |
print Dumper ($a), "-------\n"; |
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 <iostream> | |
class Ax { | |
public: | |
Ax(int a); | |
bool compare(const Ax &other); | |
private: | |
int m_a; | |
}; |
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 Mojolicious::Lite; | |
use POSIX; | |
get '/' => sub { | |
my $child = fork(); | |
unless (defined $child) { | |
die "fork(): $!"; | |
} | |
elsif ($child == 0) { |
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 Tie::IxHash; | |
use JSON::PP; | |
# magic start | |
my $obj_parser_sub = \&JSON::PP::object; | |
*JSON::PP::object = sub { | |
tie my %obj, 'Tie::IxHash'; | |
$obj_parser_sub->(\%obj); |
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 Coro::LWP; | |
use Coro; | |
use LWP; | |
use Test::More tests => 1; | |
sub make_broken_http_server { | |
my $serv = IO::Socket::INET->new(Listen => 1); |
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
$i++%50||++$j&mkdir($f="folder$j")&($i=1),rename$_,"$f/$i"for<*> |
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
my $str = '0123456789'; | |
$str =~ s/(?<=.)(?=(?:\d{3})+$)/ /g; |
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 utf8; | |
my $мама = 'рама'; | |
sub мой($) { | |
print "я мою ", shift, "\n"; | |
} | |
мой($мама); |
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
package Syntax::method; | |
use Devel::Declare; | |
use B::Hooks::EndOfScope; | |
use strict; | |
sub import { | |
my $class = shift; | |
my $caller = caller; | |
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
CREATE TABLE `dbrepl`.`allok` ( | |
`id` int(11) NOT NULL AUTO_INCREMENT, | |
`name` varchar(256) NOT NULL, | |
`type` enum('TYPE_OK','TYPE_FAIL') NOT NULL, | |
PRIMARY KEY (`id`) | |
) ENGINE=MyISAM DEFAULT CHARSET=utf8 |