if (grep {/$backup_job/} ) { print "backup job found for $backup_job\n"; } else { print "$backup_job does not have a backup job !!\n"; }