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
my %uni2ascii = ( | |
"\x{00AB}" => '"', "\x{2018}" => "'", "\x{2236}" => ':', | |
"\x{00AD}" => '-', "\x{2019}" => "'", "\x{223C}" => '~', | |
"\x{00B4}" => "'", "\x{201A}" => ',', "\x{2264}" => '<', | |
"\x{00BB}" => '"', "\x{201B}" => "'", "\x{2265}" => '>', | |
"\x{00F7}" => '/', "\x{201C}" => '"', "\x{2266}" => '<', | |
"\x{02B9}" => "'", "\x{201D}" => '"', "\x{2267}" => '>', | |
"\x{02BA}" => '"', "\x{201E}" => '"', "\x{2303}" => '^', | |
"\x{02BC}" => "'", "\x{201F}" => '"', "\x{2329}" => '<', | |
"\x{02C4}" => '^', "\x{2022}" => "*", "\x{232A}" => '>', |
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
#!/bin/bash | |
# Executable documentation, lines starting with "> " will be echoed | |
# (Probably a bad idea, but kind of fun) | |
# ./INSTALL # | bash -x - | |
grep \^\\s*\> $0 | cut -c5- | |
exit # don't run anything unprocessed | |
(Semi-) Literate Bash Script | |
---------------------------- |
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 -l | |
package A; | |
use strict qw(subs); | |
use warnings; | |
no warnings 'uninitialized'; | |
use Variable::Magic qw(wizard cast VMG_OP_INFO_NAME); | |
my $wiz; | |
BEGIN { |
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 | |
# | |
# Benchmark script for Date validation methods. | |
# | |
use strict; | |
use warnings; | |
use Benchmark qw(:all :hireswallclock); | |
use DateTime; | |
use Time::Piece; | |
use Time::Local qw(timelocal); |
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
diff --git pod/perlop.pod pod/perlop.pod | |
index 40402be..4a2817c 100644 | |
--- pod/perlop.pod | |
+++ pod/perlop.pod | |
@@ -1138,10 +1138,11 @@ both its arguments into the list. These arguments are also evaluated | |
from left to right. | |
The C<< => >> operator is a synonym for the comma except that it causes a | |
-word on its left to be interpreted as a string if it begins with a letter |
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
diff --git lib/DBIx/Connector.pm lib/DBIx/Connector.pm | |
index 75f4e7d..e330c75 100644 | |
--- lib/DBIx/Connector.pm | |
+++ lib/DBIx/Connector.pm | |
@@ -22,22 +22,25 @@ sub DESTROY { $_[0]->disconnect if $_[0]->{_dond} } | |
sub _connect { | |
my $self = shift; | |
+ my @args = @{ $self->{_args} }; | |
+ $args[2] = $args[2]->() if ref $args[2] eq 'CODE'; # reveal wrapped password |
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
diff --git lib/DBIx/Connector.pm lib/DBIx/Connector.pm | |
index 75f4e7d..ab4807f 100644 | |
--- lib/DBIx/Connector.pm | |
+++ lib/DBIx/Connector.pm | |
@@ -10,8 +10,9 @@ our $VERSION = '0.52'; | |
sub new { | |
my $class = shift; | |
+ my @args = @_; | |
bless { |