Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Journal of cosimo (4138)

Thursday May 22, 2008
04:25 PM

YouTube Data API

Do any of you have some insights or experiences to share about using YouTube Data API?

It seems WebService::YouTube uses the older API, not the newer GData one. And although there's a Net::Google::GData, it doesn't work under Windows.

I have looked at the youtube-g ruby package and it seems pretty clean and straight-forward.

So question, before I write my own wheel, or consider patching WebService::YouTube, is there something I'm missing here?


04:20 PM

Regarding file locking...

This should have gone out as a reply to AdamK, but doesn't want to collaborate. Sorry Adam.

For sure, if there's one thing that's a pain is file locking. I have no recommendations for you, but recently for $work, I wrote a class for general file locking, not just a script (yes, I know, don't tell me).

For about 6-7 years I've been using Fcntl and flock without problems, but now it's different. I need to gracefully handle file locking even on NFS volumes and with many concurrent hosts that write on the same nfs share.

And yes, it's crazy. And no, File::NFSLock doesn't work for me. LockFile::Simple does, but needs to be tweaked, hence my class that extends and "fix" it... :)

Me too: any recommendations?

Wednesday May 07, 2008
03:30 AM

I'm not sure I understand SQL...

Can any good souls out there explain to me why this SQL query actually works? And no, it doesn't matter what it does... I already know that :)

    SELECT concept, count(*) AS cnt, c.rtype
      FROM concepts JOIN conceptbindings AS c
        ON (c.conceptid =
  GROUP BY concept
     LIMIT 0,100;

If there's some explanation which I missed entirely (and that's possible), good.
If there's not, can you guess the DBMS ? :)

Sunday April 06, 2008
07:23 AM

My Oslo QA Hackaton - Day 2 (in progress...)

This morning, after the coffee-powered briefing, I bugged David about CPAN::Shell. David patiently explained to me the thing. Thanks Dave! Then I went to bug Adrian about Test::Class::Load. After a short chat, I decided to hack on Test::Class::Load, originally by Ovid, :-), to make it subclassable and to allow custom filtering of underlying files to be loaded.

This is something I'd have liked to work on for some time, and we actually need this at $work.

Some hours later, I had put together a patch for Test::Class 0.28, which will hopefully become 0.29. Let's see... :-)

Saturday April 05, 2008
10:39 AM

My Oslo QA Hackaton - Day 1

What can I say? I'm really happy I came here. Linpro's offices, the venue for the hackaton, are really at 5 minutes cycling distance from my house... :-)

Lots of cool people and interesting discussions. ADAMK, MarkOv, Andy Armstrong, DOMM, Ovid, Marcus, Merijn, the FreeBSD guys, Schwern, brian d foy, DAGOLDEN, Jonathan Worthington... Need to say more?

I even bugged JW to teach me something about Perl6 parser and actions...
Thanks to Marcus and Andy, there's also a nice Flickr photo collection...

Sadly I have to leave now, but I hope to get around here some time tomorrow...

Anyway, I haven't really understood if I should stick with EU::MM, or go for Module::Build, or even Module::Install... :-)

Monday March 03, 2008
05:46 PM

Let's see if I get it right this time...

Yes, I published an updated version of Win32::API, tagged v0.54 which should solve the OS check and META.yml problems, preserving the "os unsupported" CPAN testers check.

Let's see if I got it right this time, without screwing up again... :-)

Saturday March 01, 2008
07:29 PM

Win32::API v0.53 released to CPAN

I just released version 0.53 of Win32::API. It should be available at your local CPAN mirror very soon.

This version should play nicer with CPAN testers, since it checks if the OS makes sense before going through Makefile.PL, so no more failures with Solaris, Linux, FreeBSD, and such are expected.

Please note that I published 0.51 one hour ago, but it's broken, so I have already scheduled its deletion. Please don't use 0.51.

Enjoy and please report to me any problems you have.

UPDATE: it seems that I screwed up again the META.yml and the dist resulted as UNauthorized because of my inclusion of Devel::AssertOS. Oh well...


For the real list of changes, look at CPAN's Changes file.


  • Devel::AssertOS was not properly set up in 0.51.


  • Cleaned up pod docs and clearly stated Win32::API license
  • Fixed $$/pid tests for Cygwin
  • Now uses Devel::AssertOS to check that we are on a Win32 or Cygwin system. This should ease the work of CPAN testers.
Wednesday February 20, 2008
04:37 PM

Win32::API v0.48 adds cdecl function call support

As you probably know, I have been struggling to get Win32::API to work on Vista with various MSVC++ and GCC compilers.

Since many have asked for it, and some brave soul had an old patch available on the net, I decided to give it a shot.
I had already tried 2 or 3 times to get this patch (originally for v0.41) integrated in the new Win32::API versions, but always failed at it.

Today I decided to take the full journey, and seems I succeeded. Probably I broke something else... :-)
Please bare with me. Anyway, I have 2 things left in this release that I want to address in the new one:

  • There's a Borland C macro def that is completely broken (thanks to BrowserUk for noticing)
  • I need to complete the stack cleanup assembler code at the end of Call() function in the XS code. This should be easy, for some definition of "easy", since I already have some examples of MSVC/GCC assembler code in my RT queue.

In the meanwhile, if you notice something wrong with your OS/Perl/compiler, please mail me or fill in your bug report in RT. Thanks!

Friday December 28, 2007
05:49 PM

Windows Vista compile of Win32::API with MinGW & MSVC++

On my main PC used to develop CPAN work on Windows I had installed MSVC6, cygwin and strawberry/vanilla Perl.

At the start of November I had to switch to a new laptop with (arghh...) Vista. Then I installed MSVC++ 2005 and 2008, the free editions. And I installed also the Windows Server 2003 Platform SDK, which I thought was the SDK to go with.

Last week Vista ended up filling all its allocated disk space, and I decided to dump all MSVC & SDK installations plus other stuff to DVDs.

Then I reinstalled the compilers and the Microsoft Windows Vista SDK but since then I never got to compile anything again. The error messages are like the following:

gcc -c -I"\Program files\Microsoft SDKs\Windows\V6.0\Include" -I"\Program files\ Microsoft SDKs\Windows\V6.0\VC\include" -s -O2 -DWIN32 -DHAVE_DES_FCRYPT -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -fno-strict-aliasing -DPERL_MSVCRT_ READFIX -s -O2 -DVERSION=\"0.47\" -DXS_VERSION=\"0.47\" "-IC:\strawberry\ perl\lib\CORE" Callback.c
In file included from /Program files/Microsoft SDKs/Windows/V6.0/Include/winnt.h :105,
from /Program files/Microsoft SDKs/Windows/V6.0/Include/windef. h:177,
from /Program files/Microsoft SDKs/Windows/V6.0/Include/windows .h:155,
from Callback.xs:17: /Program files/Microsoft SDKs/Windows/V6.0/Include/basetsd.h:81: error: syntax e rror before "INT64"
/Program files/Microsoft SDKs/Windows/V6.0/Include/basetsd.h:81: warning: data d efinition has no type or storage class
/Program files/Microsoft SDKs/Windows/V6.0/Include/basetsd.h:85: error: syntax e rror before "UINT64"
/Program files/Microsoft SDKs/Windows/V6.0/Include/basetsd.h:85: warning: data d efinition has no type or storage class
/Program files/Microsoft SDKs/Windows/V6.0/Include/basetsd.h: In function `PtrTo Ptr64':
/Program files/Microsoft SDKs/Windows/V6.0/Include/basetsd.h:363: error: syntax error before "__int64"

They seem to be related to this basetsd.h header file and the INT64 typedefs.

Now I don't know if the Vista SDK is screwed up, and I'd better revert to the Win 2003 Server SDK, or I did something else which screwed up everything...

What the _______ is going on here? Anyone has experiences with Perl gcc/MSVC compiles on Vista?

Anyway, I remember having correctly compiled perl-5.10, parrot and Win32::API with MSVC2005 and 2008 with W2003 Platform SDK. I will try to revert back to that and retry everything from scratch.

I promise I will write a step-by-step walk-through if everything works in the end.
BTW, I'm also working on patching ExtUtils::MakeMaker to correctly detect the PASTHRU_INC Makefile variable (there's already a ticket on RT about that).

Tuesday August 28, 2007
02:31 PM

Fortune file about 24's Jack Bauer

... and I finally managed to assemble a fortune file about Jack Bauer facts.

I looked at some websites that carry a lot of facts about Jack, like, or

Of course, this was done with a Perl script. The good guys among you :-) already know that that very script is included in the shiny new pointless CPAN distribution named Acme::24.

Here it is!
You should generate also the ".dat" file to use with fortune program. The command is:

strfile -r jackbauer

This generates a "jackbauer.dat" file that should be copied into your "/usr/share/fortune" (or whatever) folder. Enjoy!