Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^2: anonymous subroutines assigning regexes to hash keys

by donkeykong (Novice)
on Jul 30, 2009 at 06:21 UTC ( [id://784501] : note . print w/replies, xml ) Need Help??


in reply to Re: anonymous subroutines assigning regexes to hash keys
in thread anonymous subroutines assigning regexes to hash keys

I was just making a very abstract version of what I intend on doing. There are going to be several files, and those files come with ID numbers, and the array is going to get automatically populated with the id numbers. So when I go through the file per ID number, it's because it's supposed to go through that entire file per ID number. I can see how this would look wrong based on the abstract version I put up. I was just trying to show what it would do in terms of the actual anonymous subs in the hash of hashes. This is what the inside of a file will look like:
headline: this is the headline byline: this is the byline (and so on)
I want to grab all the stuff after the (text):. So the inner hash has the key, which is supposed to have the value of the text after the colon, and was thinking of using an anonymous subroutine to perform a regex and capture just what I wanted. Does this make sense?