I
ioneabu
I was complaining before about how difficult it was going to be to get
Perl working on my Pocket PC pda (a Dell Axim 3). The fact that it
does not come with the Perl libraries and that there are registry
changes to make turned me off to trying it. The word 'registry' makes
me cringe. I don't know why I have this aversion to the Windows
registry, but I just do. I guess if you want to keep a secret from me,
hide it in the registry.
Anyway, I was determined to make it work no matter how difficult or
time consuming. I went to
http://www.rainer-keuchel.de/wince/perlce.html for files and
instructions.
It turned out to be very straight forward and easy. As far as the
registry stuff, he lays it out in a sample batch file which makes it
also very easy. I installed ActivePerl on my Windows computer to get
the libraries and I threw in a few more from CPAN. It is really,
really cool to have Perl running on my pda.
Here's my first script, written and executed entirely on the pda. It
is to fix a bunch of files with Weight Watcher's daily points and add
the total at the bottom of each file:
#!/usr/bin/perl
use File::Slurp;
@a = read_dir('\\oldpts\\');
foreach(@a)
{
@b = ();
@b = read_file("\\oldpts\\$_");
if (not (grep /^total/, @b))
{
$c = 0;
map
{
/^(\d+)\s/;
$c += int $&;
} @b;
push @b, "total: $c";
write_file("\\oldpts\\$_",@b);
}
}
I know it is not entirely efficient, but it worked. I couldn't believe
how fast it ran. One second to compile and no time to process dozens
of files. Now I just need the portable keyboard
wana (now using map and grep a little
Perl working on my Pocket PC pda (a Dell Axim 3). The fact that it
does not come with the Perl libraries and that there are registry
changes to make turned me off to trying it. The word 'registry' makes
me cringe. I don't know why I have this aversion to the Windows
registry, but I just do. I guess if you want to keep a secret from me,
hide it in the registry.
Anyway, I was determined to make it work no matter how difficult or
time consuming. I went to
http://www.rainer-keuchel.de/wince/perlce.html for files and
instructions.
It turned out to be very straight forward and easy. As far as the
registry stuff, he lays it out in a sample batch file which makes it
also very easy. I installed ActivePerl on my Windows computer to get
the libraries and I threw in a few more from CPAN. It is really,
really cool to have Perl running on my pda.
Here's my first script, written and executed entirely on the pda. It
is to fix a bunch of files with Weight Watcher's daily points and add
the total at the bottom of each file:
#!/usr/bin/perl
use File::Slurp;
@a = read_dir('\\oldpts\\');
foreach(@a)
{
@b = ();
@b = read_file("\\oldpts\\$_");
if (not (grep /^total/, @b))
{
$c = 0;
map
{
/^(\d+)\s/;
$c += int $&;
} @b;
push @b, "total: $c";
write_file("\\oldpts\\$_",@b);
}
}
I know it is not entirely efficient, but it worked. I couldn't believe
how fast it ran. One second to compile and no time to process dozens
of files. Now I just need the portable keyboard
wana (now using map and grep a little