Perl of wisdom

I was using my "zim" wiki and I decided to make some changes to how it handled files. It is written in the "perl" language and to give a quick example, it looks like this:

sub _read_list { 
 my ($mimetype, $file) = @_;
 my @list;
 open LIST, "<$file" or croak "Could not read file: $file";
 while (<LIST>) {
  /^\Q$mimetype\E=(.*)$/ or next;
  push @list, grep defined($_), split ';', $1;
 }
 close LIST;
 return @list;
}

The picture is a snap of a modified selection menu. The wiki uses GTK2 which is gnome toolkit with a perl interface. The thing that was bugging me is that I have KDE desktop and the zim wiki likes to use the gnome selections for opening objects. So I fixed that for them. I need to do a diff, just for the heck of it when I am done. I need to use my perl once in a while or it gets rusty.

I had a PHP wiki for a while and that was too much trouble to maintain for my personal use. It is the same code that runs Wikipedia and it has to be setup as a server. That was a full day of headaches. Mostly I want to "own" all the software I get for free and be able to say that it doesn't have a sneaky little trap embedded in it. I can read the code above very easily and much of what I read in programming probably just looks like nonsense to most people.

Mostly it helps me to focus on solving problems as I am trying to resolve an issue with embryogenesis and I know there is a short hand for the whole thing and I haven't found it yet.

0 comments:

Contributors

Automated Intelligence

Automated Intelligence
Auftrag der unendlichen LOL katzen