I think that you have evaluated the array in scalar context. In scalar
context, arrays evaluate to their size. So, 111 means that it has 111
elements in it.
I've fixed up the code sample you provided - see
https://gist.github.com/920575.
You should always use strict and use warnings - these help you catch
basic errors (for example, you can't use $bot on the right side of the
'or' condition on line 13 when trying to create the bot object. If
creating it fails, there will be no $bot to refer to there. You can find
more of the usual recommendations at http://hashbang.ca/perl/the-usual
Also, you need to know what kind of data structure you're accessing.
Each element of @hist is a reference to a hash. You need to unpack it to
get your data - I've shown you one way to do that on line 19. The
documentation for get_history is not very good, I will try to improve it
before the next release, which will be in about 1 week's time.
Finally, I removed some things you don't need to call - for example, you
don't need to set_wiki() if you already gave that when creating the bot
object. For WMF wikis, it is sufficient to provide the host. That will
come as you use MediaWiki::Bot more. It has a somewhat 'organic' API :)
> By the way, why don't we have access to the entire history (limited to
> 500) ? How can I avoid this limitation ?
Do you really need to use the live site? You might find that downloading
a database dump works better for your methodology. If that won't do, you
can request a bot account, which will allow you to access up to 5000.
And, even in batches of 500, you can get the whole page history.
-Mike