greping each line is expensive.  If you are already going to load it into memory, please do so with Cpanel::LoadFile::loadfile and do something like

index($cron_file_contents,$clamav{'freshclam'}{'bin'});