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 v5.10; | |
| use warnings; | |
| use strict; | |
| use EV; | |
| use AnyEvent; | |
| use Sys::Hostname qw(hostname); |
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 | |
| # mx.psgi -- get geographic information about a domain's mailservers | |
| # This was written purely as an example real-world-ish non-blocking | |
| # Plack/PSGI application because I'm sick of seeing the usual | |
| # "Hello World"-esque examples. | |
| # In one shell: | |
| # $ feersum --listen :5000 -a mx.psgi | |
| # |
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 warnings; | |
| use strict; | |
| use Mojo::UserAgent; | |
| die "usage: cpanver <module>\n" unless @ARGV; | |
| my ($module) = @ARGV; |
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
| -module(xmas). | |
| -export([tree/1]). | |
| tree(Width, _, _) when Width < 3 orelse Width > 21 -> | |
| error( { out_of_range, { min, 3 }, { max, 21 }, { input, Width } } ); | |
| tree(Width, _, _) when Width rem 2 == 0 -> | |
| error( { width_is_not_odd, Width } ); | |
| tree(Width, Trunk, Leaves) -> | |
| lists:foreach( | |
| fun (A) -> |
NewerOlder