« Norrrthern Irrrreland!!! | Main | Wonky Turntable »

printf

For all you proper perl programmers do not read this post. However for anyone who is a casual perl hacker like myself please do one thing and read up on printf.
I often email Colm and Duggie at Blackstar with idiotic questions about pieces of code that I have written. I had a really retarded piece of code, which padded a string. I had to have a course id
of uudc00000{$courseid}, I had written code which counted the length of the courseid variable and appended zeros to make a 6 digit string based on that length. I was pointed in the direction of printf, which I knew about but have never really bothered using, how lazy is that.
printf takes care of it like so:
printf("uudc%06d", $courseid);
printf is one of those great functions I can't believe I have never used.