Recently in perl Category

Installing Google::Checkout::* in Debian:

apt-get install libxml-writer-perl libcrypt-ssleay-perl libdate-manip-perl

cpan Google::Checkout::General::GCO

Installing Net::Amazon::S3 in Debian?  This might help.  I'm documenting it here because I have had to do this so many times in the past few weeks.  It's not hard, but it's definitely annoying to have to find all the modules that Net::Amazon::S3 depends on.

apt-get install libxml-libxml-perl libmoose-perl libmoosex-strictconstructor-perl libregexp-common-perl libclass-mop-perl libdatetime-format-iso8601-perl libdigest-md5-file-perl libnamespace-clean-perl libtest-use-ok-perl libtime-duration-parse-perl libdatetime-format-natural-perl libdatetime-set-perl libdatetime-perl libexception-class-perl libtest-warn-perl libtest-differences-perl libtest-deep-perl libmodule-build-perl liblwp-useragent-determined-perl

cpan Data::Stream::Bulk

cpan DateTimeX::Easy

cpan MooseX::Types::DateTimeX

cpan DateTime::Format::HTTP

cpan Net::Amazon::S3


And then if you get tired of any of the warnings when you "use" it, try this at the top of your code:

open(my $olderr, '>&', \*STDERR);
close(STDERR);
eval('use Net::Amazon::S3');
open(STDERR, '>&', $olderr);

My Appreciation for Good Tools

By Dusty on October 19, 2009 4:57 AM · No Comments
There are two specific tools that are making my life very easy right now.

1) MySQL Workbench

This is made of awesome.  It's not without its bugs (and boy does it have those), but it does a fantastic job of helping structure the database tables without needing to deal with more details than I need.  And its free (and open-source).  Plus they supply a 64-bit DEB file if you need such a thing.  I recommend getting the stable version.  The beta/dev version doesn't seem to have database sync for some reason.  It allows you to automatically update a live local or remote database server without a worry.  You will not want to be without that!

2) Rose::DB::Object

This handles many-to-many relationships so much better than Class::DBI did.  I've recently moved to R::DB::O and am not looking back.  It subclasses beautifully and helps me keep my database details and my logic separate.  Plus it deals with so much other stuff that I'm not sure how I lived without it.  There is a great tutorial, too.

Joined Debian Perl Group

By Dusty on September 15, 2009 11:55 PM · No Comments
So, I've finally joined the Perl Group within Debian.  I thought it'd be a difficult thing to do, but no... it's not.  My biggest misunderstanding of the process is that I thought I needed to be a Debian Developer (DD) to join a group.  Nay!  You just have to have a clue.  I requested assistance to gain that clue and was happily greeted with "clue".  Go to a page and read about it.  Then let them know you created a new user in the system.  Ta-da!

So now I begin lurking and watching the group.  I'm not going to do anything yet until I observe a bit about how they go about getting things done.  I'd rather not look like an idiot straight away.

In my observation thus far, I've noticed a Perl module that I'd never seen before:  Net::DRI.  Someone had just packaged it and submitted it to the group.  Basically this module is the equivalent to DBD, but for domain registry company interfaces.  It makes a single API to abstract all the different APIs provided by various registrars.  Very nice!  I haven't given it a shot yet, but the idea just sounds genius.  Who knows, maybe I'll even submit some code to handle the registrars I use.

Linux::APT 0.1 (new)

By Dusty on February 25, 2009 4:30 AM · No Comments
I created a new module and uploaded it to the CPAN.  It allows for Perl-based access to Debian's APT package management tools.  It's a bit like Windows Update for Debian-based Linux distributions.  In theory it should work for other Linux distros that have had APT added on non-standardly, though I haven't tested that yet.

Right now it lets you list the packages to upgrade, install/upgrade packages, and remove/purge packages.  I plan to add searching (for installable packages) and whatever other functions that people request.

You should find it on the CPAN sometime today, when it's finally indexed, distributed, and made available on the CPAN site.

Debian has some modules that basically do the same thing, but they're complicated and aren't typically available for those that have installed APT on non-Debian distros.  This module is easy to use and doesn't have any dependencies other than a Linux distro that can use APT itself.  Plus it's pure-perl, so it doesn't even need compiled.  This means that as long as the distro can use APT, it shouldn't matter what environment or processor it uses.
So, I've got several people using SharedPass on a regular basis now.  They seem to be happy with it.  Other than the fact that it isn't prettified yet, it's ready for full use.  Feel free to use it!

You can store your passwords with confidence in SharedPass.  All fields marked "Encrypt" are encrypted and are completely unavailable to anyone, even me.  When you create your account, you choose the level of encryption.  The default setting is more than sufficient, but even the lowest setting is very secure.

I invite you to try it out.  I want to know what you think of it.  If you have feature requests, let me know!  I'd love to enhance it in whatever ways would make it better.

http://sharedpass.com/  (redirects to an SSL'd site, of course)

Win32::WindowsUpdate 0.4 (updated)

By Dusty on February 19, 2009 3:40 AM · No Comments
http://search.cpan.org/~WILSOND/Win32-WindowsUpdate/lib/Win32/WindowsUpdate.pm

Updated again.  Added the ability to not auto reboot after patching (that's so annoying!) as well as set the auto update settings (disable, notify, download, automatic).  It's been uploaded to the CPAN and should appear soon.

Win32::WindowsUpdate 0.3 (updated)

By Dusty on February 18, 2009 7:43 PM · No Comments
I've uploaded Win32::WindowsUpdate to the CPAN.  I uploaded 0.2 as well, but it isn't nearly as good as 0.3, so I skipped that announcement.

0.2 used VBScript inside of Perl to install the updates, but 0.3 just uses Perl.  Much better.

Enjoy.

Win32::WindowsUpdate 0.1 (new)

By Dusty on February 17, 2009 5:23 PM · No Comments
Well, I changed my mind and created a Perl module to do Windows Update stuff.

Win32::WindowsUpdate should be found on the CPAN in the next day or so.

Windows Updates in Perl

By Dusty on February 17, 2009 4:36 PM · No Comments

Need to get Windows Updates via Perl?  Here's the way I did it:

use Win32::OLE qw(in);
use Data::Dumper;

my $updateOLE = Win32::OLE->new('Microsoft.Update.Session') or die "ERROR creating Microsoft.Update.Session\n";
my $updateSearcher = $updateOLE->CreateUpdateSearcher or die "ERROR creating CreateUpdateSearcher\n";
$updateSearcher->SetProperty('Online', 1); # set to 1 to check online for updates, 0 to not check online. seems to default to online.
my $queryResult = $updateSearcher->Search("IsInstalled = 0 and IsHidden = 0");
my $updates = $queryResult->Updates;

my @updates;
foreach my $update (in $updates)
{
  my $info = {};

  $info->{UpdateId} = $update->Identity->UpdateID;
  $info->{Title} = $update->Title;
  $info->{Description} = $update->Description;
  $info->{RebootRequired} = $update->RebootRequired;
  $info->{ReleaseNotes} = $update->ReleaseNotes;
  $info->{EulaText} = $update->EulaText;
  $info->{EulaAccepted} = $update->EulaAccepted;

  push(@{$info->{Category}}, {Name => $_->Name, CategoryID=> $_->CategoryID}) foreach (in $update->Categories);
  push(@{$info->{MoreInfoUrl}}, $_) foreach (in $update->MoreInfoUrls);
  push(@{$info->{KBArticleID}}, $_) foreach (in $update->KBArticleIDs);
  push(@{$info->{SecurityBulletinID}}, $_) foreach (in $update->SecurityBulletinIDs);
  push(@{$info->{SupersededUpdateID}}, $_) foreach (in $update->SupersededUpdateIDs);

  push(@updates, $info);
}

print Dumper(\@updates)