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
ok 1 - Single line check | |
not ok 2 - Multiple line check # TODO Multiline parsing | |
# Failed (TODO) test 'Multiple line check' | |
# at t/03_lines.t line 29. | |
# got: 'Just 1' | |
# expected: 'Just 3' | |
not ok 3 - Error syntax error at (eval 26) line 3, at EOF | |
# syntax error at (eval 26) line 4, at EOF | |
# syntax error at (eval 26) line 6, near "}) " | |
# syntax error at (eval 26) line 6, near "shift) " |
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
eval q[ | |
$ret = mdo { | |
mbind $x = Just 1 + 2; | |
munit $x; | |
};]; | |
if ($@) { | |
fail "Error $@"; | |
} else { | |
is_deeply( $ret, $expected, "Sanity check for next (partial line) test" ); | |
} |
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 strict; | |
use warnings; | |
use Test::More tests => 3; # last test to print | |
use MooseX::Method::Signatures; | |
my $evalcode = do { | |
local $/ = undef; | |
<DATA>; |
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 strict; use warnings; | |
use Test::More tests=>1; | |
use Devel::Peek; | |
my $peek; | |
close STDERR; | |
open STDERR, '>', \$peek; |
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
#!/usr/bin/perl | |
use strict; use warnings; | |
package Parent; | |
use Moose; | |
use MooseX::ClassAttribute; | |
class_has attr => ( | |
isa => 'Str', | |
is => 'rw', |
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
uniq = join . snd . mapAccumL f S.empty | |
where f s e | e `S.member` s = (s, []) | |
| otherwise = (e `S.insert` s, [e]) |
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
#!/usr/bin/perl | |
use strict; use warnings; | |
use Benchmark qw/timethese cmpthese/; | |
sub recur { | |
my $n = shift; | |
if ($n) { | |
return $n + recur($n-1); | |
} else { | |
return 0; |
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
import Control.Monad | |
import Data.Maybe | |
joinMaybe [] = Nothing | |
joinMaybe xs = Just $ join xs | |
fizzbuzz b = fromMaybe (show b) | |
. joinMaybe | |
. concatMap (\f -> f b) | |
$ [aux "fizz" 3, aux "buzz" 5] |
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
#!/usr/bin/perl | |
use strict; use warnings; | |
use Data::Dumper; | |
use Sub::Curried; | |
use Carp qw(croak cluck); | |
my @stream = split /\n/, <<'EOF'; | |
method foo { say $x } | |
EOF |
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 strict; | |
use warnings; | |
use Data::Dumper; | |
use DBI; | |
my $dbh = DBI->connect( 'dbi:CSV:', '', '', | |
{f_dir => '.', | |
f_ext => ".asc/r", | |
csv_sep_char => "\t", | |
}) |
OlderNewer