in reply to Re^2: grep question
in thread grep question

Personally, I'd use both map and grep for what the OP is doing:

return map { /memtype=(.*)/i; $1 } grep /memtype=/, $self -> collect_d +ata ('all');
I realise that this probably doesn't speed things up, maybe even slows it down. But it does what it says much more obviously to me. I'm collecting all the data. Then I'm extracting just the ones I want (memtype), and then I'm grabbing the stuff on the right of the equals sign. Just seems more straightforward to me. As for brian d foy's concern about using $1 when you haven't checked if it matched, I hope this is ok - I agree with him, and I think this is ok. ;-)