in reply to grep or perl

I can do it in perl easily...

Why not just do it in Perl then?

Personally if Perl will do it for me then I would use that and move on