# Assuming file name is in $ARGV[0] while(<>){ print if /is alive/; }