Data Extraction problem in perl

Hello,

I want to extract the words from a file which starts with SRD-R or SRD-DR.
I have written a script which is able to trace the word but it is printing the whole line.

sub extract_SRD_tag{

my ($tag, $app, $path, @data, $word );
$path = shift;
$app = shift;

open (FILE, $path) or die ("unable to open the file\n");

@data = <FILE>;

foreach $word (@data){

   if ($word =~ m/SRD-/){
      print $word,"\n";
      
      if ($word )
   }
   
}

print "The path is ", $app;

close (FILE);

}

But i want to keep all the found data in one array and and print that array.......
Thanks for u r response in advance.

 if ($word =~ m/.*(SRD-[^\s]+).*/){
      print $1,"\n";
}

Guru.

thanks guruprasad....

I want to search all the word which ends with "_4digits"
example:
SRD-DR AAP_0010
(words which starts with SRD- and ends with _0010(it can be any 4 digits))