in reply to Isn't there a print line function?
If you want to find which lines match a pattern you an use grep and if you want to print all them out you can use something like:
print join('', grep(/whatever/, @lines));
If you just want to print out the first match you can use
print ((grep(/whatever/, @lines))[0]);
print join('', grep(/whatever/, @lines));
If you just want to print out the first match you can use
print ((grep(/whatever/, @lines))[0]);
In Section
Seekers of Perl Wisdom