Home

Thu, Oct. 30th, 2008, 08:59 pm

I found a use for the Acme::Don't module today.  It was easier to comment out a large block of code with it than pod.

Fri, Oct. 3rd, 2008, 05:00 pm
Victory over the CPAN automated testers

Tk::TextVi is 15 for 15 in the latest version.  No more spurious FAIL reports due to testers who don't really have a functioning Tk.

Fri, Apr. 4th, 2008, 07:45 pm

Every time I reread perldoc I learn something new...

#Just Another Perl Hacker
$ENV{PERL5DB}='*DB::DB=sub{}';$^P||exec"$^X -d $0";
print@{"_<$0"}[1]=~/#(.*)/;

JAPH printed from a comment!

Sun, Mar. 16th, 2008, 01:34 pm

I thought the somewhat unstable Tk::Columns might be the problem, so I switched to the standard Tk::Table.

Same error.

I guessed that the Tk error I was getting was caused by a problem in Perl 5.10.0, so I wiped out the install and brought Perl 5.8.8 back.

Same error.

I then hits me that Tk doesn't play nice with threads and my program contains a fork (which on windows is emulated using threads).  I change the compile-time "use Tk" to a runtime "require Tk" after the fork occurs and everything is working fine.

Now I either need to restore my Perl 5.10.0 install or rewrite a few hundred lines littered with // operators.

Sat, Dec. 22nd, 2007, 07:27 pm
Why I shouldn't be allowed to use Perl...

./notes.pl E E F G G F E D C C D E E D D > /dev/audio

perl source )

Tue, Dec. 4th, 2007, 08:56 pm
Scary...

Looking back over some old code I wrote to adjust my comics update list.  B::Deparse marks the old version at 56 lines of code, 1348 bytes, the new version speaks for itself

$x == 1 ? $x = 0 : (/^\S/ and print "\t\t\t\t\n") unless $. == 1;
$x = 1, next if /^\S.*\t+$/;
s/^$/\t\t\t\t/;
s/(\t[SMTWRFU-]{0,7})$/ $1 . '-' x (8 - length($1))/e;
END { print "\n\t\t\t\t" unless $x }


It's just amazing how far a little Perl knowledge goes. If I had written this in C, I can't think of anything I'd do significantly different as a novice programmer than an experienced one, I might replace a few if statements with loop control and I'd have better error checking (although it's pretty meaningless here).  Perfectly tidy, I know exactly what each of those lines do and if something needs updated only one of those lines should be relevant.

I wish we had some faster processors for embedded systems...and more memory...and a processor that could run off Perl (or LISP if need be).  The C's plenty fun, but I could really speed up my coding...

Tue, Oct. 30th, 2007, 06:55 pm
Why Perl is beyond cool...

# Pass me a code ref and see what comes out!
sub what_sub_is_this {
    *{ $::{$_} }{CODE} == $_[0] and return $_ foreach (%::);
}


With comments )