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 a/modules/decide.pl b/modules/decide.pl | |
index 95f7321..d66a810 100644 | |
--- a/modules/decide.pl | |
+++ b/modules/decide.pl | |
@@ -1,38 +1,37 @@ | |
#!/usr/bin/perl | |
use strict; | |
+use Text::ParseWords; | |
+ |
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 Text::ParseWords; | |
sub decide { | |
my $self = shift; | |
my $event = shift; | |
my (@args) = ( $event->args ); |
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 | |
sub rewrite_link { | |
my ($orig) = shift; | |
if ($orig =~ /(.*)\.chm::(.*)/) { | |
my ($chmname, $path) = ($1, $2); | |
$chmname = lc $chmname; | |
$path =~ s#/#:#g; | |
$path =~ s/\.html//; | |
return "4c_help:$chmname:$path"; |
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
package JSONTest; | |
use strict; | |
use warnings; | |
use Catalyst::Runtime '5.70'; | |
use parent qw/Catalyst/; | |
use Catalyst qw/-Debug | |
ConfigLoader |
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 $total = 0; | |
while (($id, $weight) = $sth->fetchrow) { | |
$total += $weight; | |
push @choices, [$total, $id]; | |
} | |
my $rand = rand($total); | |
my $chosen = undef; | |
for my $choice (@choices) { |
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
package Log::LSB::InitMsg; | |
use strict; | |
use warnings; | |
# Call a function from /lib/lsb/init-functions in a shell | |
sub run_with_lsb { | |
my ($class, $funcname, @args) = @_; | |
my $ret = system('/bin/sh', '-c', | |
'. /lib/lsb/init-functions ; cmd=$1 ; shift ; $cmd "$@"', |
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
andrew@mido:~$ nc -v -v dev.catalyst.perl.org 80 | |
Connection to dev.catalyst.perl.org 80 port [tcp/www] succeeded! | |
OPTIONS /repos/bast/DBIx-Class HTTP/1.1 | |
Host: dev.catalyst.perl.org | |
HTTP/1.1 200 OK | |
Date: Thu, 16 Jul 2009 02:52:34 GMT | |
Server: Apache/2.0.55 (Ubuntu) DAV/2 SVN/1.3.1 mod_fastcgi/2.4.2 | |
DAV: 1,2 | |
DAV: version-control,checkout,working-resource |
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
package Devel::OverrideExit; | |
use strict; | |
use warnings; | |
my $exit_handler = sub { | |
CORE::exit $_[0]; | |
}; | |
BEGIN { | |
*CORE::GLOBAL::exit = sub { $exit_handler->(@_) }; |
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
Index: trunk/t/unit_stats.t | |
=================================================================== | |
--- trunk/t/unit_stats.t (revision 10997) | |
+++ trunk/t/unit_stats.t (working copy) | |
@@ -3,7 +3,7 @@ | |
use strict; | |
use warnings; | |
-use Test::More tests => 12; | |
+use Test::More tests => 14; |
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 Regexp::Grammars; | |
my $grammar = qr# | |
<[definition]> ** <separator> <.separator>? | |
<rule: separator> ; | \n | |
<rule: definition> <key> (?: : <value>)? | |
<rule: key> <MATCH=string> | |
<rule: value> <MATCH=string> | |
<rule: string> <MATCH=bareword> | <MATCH=quoted> | |
<rule: bareword> \w+ |
OlderNewer