Generating an RSS feed

I’m writing my own blogging tool (in php, not perl - more to learn more of php than anything). And I was all ready to get pinging with pingomatic and I realised that I’m sorely missing an RSS feed. Well, this article on generating a feed came in very handy, very handy indeed.

In fact, the only thing it seemed to miss was the guid field. And because that’s the same as the permalink in my case, adding that was simplicity itself.

<guid isPermaLink="true"><?php echo $url; ?></guid>

:)

Technorati Tags: , ,

Installed ImageMagick from RPM

So, I’m installing ImageMagick from rpm’s on RedHat linux, easy eh?

rpm -i ImageMagick-6.2.8-3.i386
error: Failed dependencies:
libgs.so.8 is needed by ImageMagick-6.2.8-3.i386
libgvc.so.2 is needed by ImageMagick-6.2.8-3.i386
liblcms.so.1 is needed by ImageMagick-6.2.8-3.i386
libpng12.so.0(PNG12_0) is needed by ImageMagick-6.2.8-3.i386

Ah, right. Guess I need those bits then. I thought rpms sorted all that out for themselves. Never mind. Reading TFM it says type the following, that’s teach me and not reading fudge manuals:

rpm -Uvh ImageMagick-6.2.8-3.i386.rpm
error: Failed dependencies:
libgs.so.8 is needed by ImageMagick-6.2.8-3.i386
libgvc.so.2 is needed by ImageMagick-6.2.8-3.i386
liblcms.so.1 is needed by ImageMagick-6.2.8-3.i386
libpng12.so.0(PNG12_0) is needed by ImageMagick-6.2.8-3.i386

Riiiiight, same again. Back to TFM. “If ImageMagick is not available on your system, install it using up2date” *types up2date*. Thinks I need to read another manual… then forgets reason and types…

up2date -i ImageMagick-6.2.8-3.i386.rpm

It’s busy doing something, let’s hope that something is installing ImageMagick.

10 minutes later:

The following packages you requested were not found:
ImageMagick-6.2.8-3.i386.rpm

Righty then. More random guess work.

up2date -i ImageMagick :)

Woah, that actually looks like it’s doing something.

Installing...
1:ImageMagick ########################################### [100%]

Once again, guesswork wins the day.

Technorati Tags: , ,

Attempt to bless into a reference (perl)

It’s saying this because for some reason the second param to bless in your ->new() constuctor is not the name of the Object you want your reference to be, but instead it is itself a reference!

It could be that you’re passing a string reference to bless rather than a string itself in which case you’ll need to double $$ it. But in my case, like a donkey, I’d written:

my $fish = new Fish->new();

Fantastic.

I’ve just done it again oddly. No more than an hour later.
This time. I’ve tried to create a new object from it’s own handle. i.e.

$self->new();

rather than

TheClassName->new();

So bless is getting $self rather than “TheClassName” as it’s second parameter.

How do I remove or uninstall Cygwin?

I installed it having used it before in the hope of it magically making the CPAN.pm module work when trying to sort out my problems with XML::SAX. But realising that there could now be conflicts with my native PostgreSQL and Activestate perl installations I decided to backtrack.

Alas, there doesn’t seem to be an easy way…

*sob*

How to get the Perl debugger to kick in, codewise.

How often do you need to use the perl debugger? Often I presume, either that or you’re a superstar ninja coder or you have no hair left. Anyways, it’s achingly boring trying to step through code and typeing ‘n’ to step into a function when you meant to press ’s’. Well, you could set a breakpoint, but in a loop you’re still going to annoy yourself. A lot.

What you can do is use this:

$DB::single = 1;

CHRIS YOU FOOL! You may cry. That’s no different to setting a debug point anyway. Well, it is if you use your head and Perl’s logic to set it like thus:

while (something_is_happening())
{
$DB::single = 1 if (noises_from_woodshed());

...All your usual gubbins....
}

See, I’m not as silly as I look!