in reply to Nested search and print

Unless you have ommitted wider context, I'd not use perl for that:
#! /bin/sh mt schedule -info | grep task.name mt schedule -info | grep task.lastmodifiedtime