Skip to content

Instantly share code, notes, and snippets.

use strict;
use warnings;
package Task::Foo;
# ABSTRACT: No abstract given for Task::Foo
=pod
=pkgroup Modules That are Useful
=pkg Package::Name 1 foo
@dagolden
dagolden / gist:648782
Created October 27, 2010 10:15
Proposed commit message for push/pop/keys/etc patch
Allow push/pop/keys/etc to act on references
This patch updates all functions that operate directly on array or hash
containers to also accept references to arrays or hashes:
push $arrayref, @stuff;
unshift $arrayref, @stuff;
pop $arrayref;
shift $arrayref;
splice $arrayref, 0, 2;
@dagolden
dagolden / gist:649209
Created October 27, 2010 15:08
benchmarking keys
# NOTE: %HASH and $HASH are package vars; %hash and $hash are lexical vars
Rate keys %$HASH keys %$hash keys hashref() keys %{$hash} keys %{ hashref() } keys %hash keys %HASH keys $hash keys $HASH
keys %$HASH 6335/s -- 0% -0% -0% -0% -42% -42% -42% -43%
keys %$hash 6335/s 0% -- -0% -0% -0% -42% -42% -42% -43%
keys hashref() 6364/s 0% 0% -- 0% 0% -42% -42% -42% -42%
keys %{$hash} 6364/s 0% 0% 0% -- 0% -42% -42% -42% -42%
keys %{ hashref() } 6364/s 0% 0% 0% 0% -- -42% -42% -42% -42%
keys %hash 10904/s 72% 72% 71% 7
sub get {
my($self, $uri, $cb_gen) = @_;
my $http = HTTP::Lite->new;
$http->http11_mode(1); # hopefully, CPAN mirrors can handle this
my $retries = 0;
while ( $retries++ < 5 ) {
my $rc = $self->_make_request( $http, $uri, $data_cb );
if ( $rc == 401 ) {
@dagolden
dagolden / gist:670053
Created November 9, 2010 23:37
metabase feed stuff
The Atom feed is http://metabase.cpantesters.org/tail/recent.xml
The content of each entry is JSON. In the json is a "legacy_guid" field. Given that guid, a request to
http://metabase.cpantesters.org/api/v1/guid/$legacy_guid
will give the JSON 'Metabase::Fact' data.
Grab the $json->{fact}{content} field directly if you want to show it to someone as text right away without waiting for www.cpantesters.org.
@dagolden
dagolden / gist:671082
Created November 10, 2010 16:34
add api_versionstring to archname
diff --git a/Configure b/Configure
index 793f8fa..632f740 100755
--- a/Configure
+++ b/Configure
@@ -6068,6 +6068,14 @@ esac
rp='What is your architecture name'
. ./myread
archname="$ans"
+: append the api_versionstring to support INSTALL_BASE with multiple perls
+case "$archname" in
@dagolden
dagolden / gist:703356
Created November 17, 2010 12:51
perl v5.13.6 library sizes
$ du -S | sort -rn
11124 ./unicore
7056 ./pod
4224 ./x86_64-linux-ld/CORE
2812 ./x86_64-linux-ld/auto/Encode/JP
2508 ./x86_64-linux-ld/auto/Encode/KR
2176 ./x86_64-linux-ld/auto/Encode/CN
2108 ./x86_64-linux-ld/auto/Encode/TW
1772 .
1584 ./Unicode/Collate
@dagolden
dagolden / gist:703401
Created November 17, 2010 13:58
impact of removing stuff from stock perl 5.12.2
$ cd /opt/perl/v5.12.2-stock
$ du --summarize
76124 .
$ ~/git/utility-scripts/strip-pod .
$ du --summarize
72504 .
$ find . -iname "*.pod" -exec /bin/rm {} ";"
$ du --summarize
65052 .
$ rm -rf lib/5.12.2/unicore/
#!/usr/bin/env perl
use 5.010;
use strict;
use warnings;
use Config;
use CPAN::DistnameInfo;
use File::Basename;
use File::Spec;
use File::Spec::Unix;
use File::Fetch;
diff --git a/pod/perlop.pod b/pod/perlop.pod
index c577f36..1b258c0 100644
--- a/pod/perlop.pod
+++ b/pod/perlop.pod
@@ -1357,11 +1357,11 @@ process modifiers are available:
g Match globally, i.e., find all occurrences.
c Do not reset search position on a failed match when /g is in effect.
-If "/" is the delimiter then the initial C<m> is optional. With the C<m>
-you can use any pair of non-whitespace characters