in reply to Discussion(maybe?) How would you do this? Modules and reading a file/dir

From the example you specified, it sounds like the thing you are missing is the idea of callbacks. I haven't used them much personally (beyond sort()), but it sounds like the idea you want-passing in a reference to a function to be used (a coderef) on the data you are processing. I would recommend looking at Mark J. Dominus's Higher Order Perl or a similar reference for more details.

Hope that helps.

Update: 2014-02-25
Fix error in link to sort().

  • Comment on Re: Discussion(maybe?) How would you do this? Modules and reading a file/dir