in reply to perl function complexity

You can measure the size of a given data structure using Devel::Size.