Skip to content

Instantly share code, notes, and snippets.

View schwern's full-sized avatar

Michael G. Schwern schwern

View GitHub Profile
package Foo;
use parent 'signatures';
sub import {
my $class = shift;
my $caller = shift;
$class->setup_for($caller);
return;
package Foo;
use strict;
use warnings;
use parent 'signatures';
require Method::Signatures;
sub proto_unwrap {
my $class = shift;
return Method::Signatures->parse_sub( proto => $_[0] );
#include <unistd.h>
#include <stdlib.h>
/*
* Meant to mimic the shell command
* exec perl -Mperl5i "$@"
*
* This is a C program so it works in a #! line.
*/
qr{
\b
(
# scheme or schemeless
([\w-]+://? | www[.])
# anything but whitespace or brackets
[^\s()<>]+
# letters and numbers in parens
#!/usr/bin/perl
use utf8;
use YAML::XS qw(Load);
binmode $_, ':encoding(utf8)' for (*STDIN, *STDOUT, *STDERR, *DATA);
#no utf8; # its interfering with the DATA loading
my $authors2email = Load(join "", <DATA>);
exit;
#!/usr/bin/perl -w
use strict;
use warnings;
use Benchmark qw(cmpthese);
BEGIN {
*CORE::GLOBAL::require = sub {
return CORE::require $_[0];
#!/usr/local/bin/perl
use perl5i::0;
use File::Copy;
my %Is;
my $builder;
my $build_file;
my @build_args;
#!/bin/bash
# Find the child of the current (or supplied) commit.
REV=$1
if [ x$REV == x ]; then
REV="HEAD"
fi
#!/usr/bin/perl -w
use strict;
use warnings;
use List::MoreUtils qw(uniq);
use Benchmark qw(cmpthese);
sub somni_uniq { my %seen; grep { !$seen{$_}++ } @_ }
#include <time.h>
#include <stdio.h>
int main() {
time_t now = -4136232677718LL;
printf("%lld\n", (long long int)timegm(gmtime(&now)));
return 0;
}