Skip to content

Instantly share code, notes, and snippets.

View wchristian's full-sized avatar

Christian Walde (Mithaldu) wchristian

View GitHub Profile

Dancing on Windows in Stop-Motion

Short version: Perl debugger is awesome. Komodo IDE makes it even more awesome and can play with the guts of a Plack web-app while the web-app is running on a web server. And now all of this now works on Windows too, by updating Plack and applying a tiny patch to Komodo.

Recently I wanted to do some Dancer development on Windows. For me web development means making use of some fairly powerful tools in order to remove delays and increase the turnaround speed. Sadly the state of the stack under Dancer, as well as one of these tools hampered my efforts, leading me to fix them. In following I will lay out the tools, the needed fixes and my web development workflow.

My favourite tool in the vast toolbox Perl provides is the debugger. Simply adding '-d' to the command line permits stepping through a program statement by statement, halt at any line, halt only when certain conditions are fulfilled and most importantly: It permits examination of the content of any variable at runti

Dancing on Windows in Stop-Motion

Ahead: My platform is Windows, however this post will also be interesting for users of other platforms, since all of the tools mentioned are multi-platform.

Recently I wanted to do some Dancer development on Windows. For me web development means making use of some fairly powerful tools. Sadly the state of the stack under Dancer, as well as one of these tools hampered my efforts, leading me to fix them. In following I will lay out the tools, the needed fixes and my web development workflow.

My favourite tool in the vast toolbox Perl provides is the debugger. Simply adding '-d' to the command line permits stepping through a program statement by statement, halt at any line, halt only when certain conditions are fulfilled and most importantly: It permits examination of the content of any variable at runtime by simply issueing 'x %var' and even to execute arbitrary code at runtime to change variable contents, thus allowing more complex analysis on variable states or change on

--- RedirectStdOutput.pm 2011-05-01 14:56:33.718750000 +0200
+++ RedirectStdOutput.pm 2011-05-01 14:57:01.062500000 +0200
@@ -150,7 +150,10 @@
}
sub BINMODE {
- _buildMessage_Die('have their mode changed');
+ my ( $self, $layer ) = @_;
+
+ return binmode $self->{h_old}, $layer if $layer;
D:\dbic\DBIx-Class-0.08190_01\DBIx-Class-0.08190_01>perl Makefile.PL
*** Module::AutoInstall version 1.03
*** Checking for Perl dependencies...
[Core Features]
- DBD::SQLite ...loaded. (1.31 >= 1.29)
- File::Temp ...loaded. (0.22 >= 0.22)
- Package::Stash ...loaded. (0.29 >= 0.28)
- Test::Builder ...loaded. (0.98 >= 0.33)
- Test::Exception ...loaded. (0.31 >= 0.31)
Using username "root".
Authenticating with public key "Christian Walde" from agent
Last login: Mon May 2 10:51:27 2011 from 80.81.255.97
[root@data-stats ~]# vi sv_inst.sh
[root@data-stats ~]# cat sv_inst.sh
#!/bin/sh
#
# install daemontools on fedora/redhat linux
#
# Mike Jackson <[email protected]> 5 NOV 2005
11-05-01@00:11:50 ºº¹º Join» (alester) ([email protected])
11-05-01@00:13:10 (alester) Who runs #perl-cats?
11-05-01@00:15:06 (alester) Is there a code of conduct here?
11-05-01@00:15:11 (alester) That the ops have to follow/
11-05-01@00:15:31 (alester) I'd love it if there was one, so that I could tell people about it on Perlbuzz and say "look, this channel is very specifically anti-asshole."
11-05-01@00:16:57 (Mithaldu) if it helps, i was told that talking about perl6 is fine
11-05-01@00:17:39 (alester) OK
11-05-01@00:17:48 (alester) Someone runs the channel and has ops, right?
11-05-01@00:18:03 (Mithaldu) i assume f00li5h does since he set the topic
11-05-01@00:19:26 (alester) Would love to see something nailed down that we could point as as code of conduct.
# This Makefile is for the ExtUtils::MakeMaker extension to perl.
#
# It was generated automatically by MakeMaker version
# 6.571 (Revision: 65710) from the contents of
# Makefile.PL. Don't edit this file, edit Makefile.PL instead.
#
# ANY CHANGES MADE HERE WILL BE LOST!
#
# MakeMaker ARGV: ()
#
@user_code_result = eval {
my @res = $code->();
$inner_error = $@;
return @res;
};
use strict;
use warnings;
use Date::Calc qw( Decode_Date_EU Add_Delta_Days );
my @marges = (
{
von => '1.1.2010',
bis => '31.12.2010',
},
c:\Perl123>perl -e "print system( 'perl -e \"binmode STDOUT, \':encoding(greek)\'; fork; print;\"' );"
65280
c:\Perl123>perl -e "print system( 'perl -e \"binmode STDOUT, \':encoding(greek)\'; print;\"' );"
0
c:\Perl123>perl -e "print system( 'perl -e \"fork; print;\"' );"
0
c:\Perl123>perl -V
Summary of my perl5 (revision 5 version 12 subversion 3) configuration:
Platform: