my @matches = foo ($content); print "Data:@matches\n"; sub foo { return shift =~ /DATA\s+([A-Za-z\W]+)\n/g; }