2012-05-01

purplecat: Hand Drawn picture of a Toy Cat (Default)
[personal profile] purplecat2012-05-01 07:32 pm

Can a journal entry id be 0?

For Bug 2152 I've found I need to create a subroutine that checks whether a form element refers to a valid entry in the user's journal separately from the various subroutines for actually saving it as a sticky.

If a journal entry id can never be zero then this subroutine could return the id number if it is valid and 0 otherwise. In that case the subroutine can replace duplicate code in at least two places, but obviously if an entry can be 0 then the subroutine had better just return 0 or 1.
sophie: A cartoon-like representation of a girl standing on a hill, with brown hair, blue eyes, a flowery top, and blue skirt. ☀ (Default)
[personal profile] sophie2012-05-01 11:07 pm

DW object-oriented programming explained (Part 3) - using classes

It's been a while since I posted anything in this series of entries, and I apologise for that! Today, though, I'll be explaining how to actually use classes in Perl and the Dreamwidth code and constructing new objects.

How do you use classes? )

That's a lot to take in, so I'll leave off for now! I hope I've explained things well, but I'm sure that there are bits that are going to be incomprehensible. If you need me to explain anything further, please ask in the comments - I'll be happy to try to explain it.