- or download this
my $last_match;
if ( grep { /^tag\: (.*)$/ and $last_match = $1 and 1} <FILE> ) {
print "Found tag: $last_match\n";
}
- or download this
while (<FILE>) {
next unless /^tag\: (.*)$/;
print "Found tag: $1\n";
}
- or download this
print map /^tag\: (.*)$/ ? "Found tag: $1\n" : (), <FILE>;