use strict; use warnings; my $PatchPath = "patch-5.1.1.21510.gpg"; my $output = "update patch-5.1.1.21510"; my @array = split /\s+/, $output; if ( grep { $PatchPath =~ /$_/ } @array ) { print "Match found\n"; }