Foreach-loop for and print commands
This is shorter, but not necessarily more efficient,

my $examine = shift; my $detect = 0;
for my $ProteinDB (@DB) {
    next if $ProteinDB-&gt;{'ID'} !~ /$examine/;
    $detect = 1;
    print "$_ $ProteinDB-&gt;{$_}\n\n"
      for grep $_ ne "ID" &amp;&amp; $_ ne "SQ", keys %$ProteinDB;
    print "SQ  $ProteinDB-&gt;{SQ}\n//\n";
}
$detect or print "Error : For the ID $examine NO-Entry could be Found !\n";


and if you push it little more,

my $examine = shift; my $detect = 0;
print map {
    $detect = 1;
    my $ProteinDB = $_;
    (
      (map "$_ $ProteinDB-&gt;{$_}\n\n", grep $_ ne "ID" &amp;&amp; $_ ne "SQ", keys %$ProteinDB),
      "SQ  $ProteinDB-&gt;{SQ}\n//\n"
    );
  }
  grep $_-&gt;{ID} =~ /$examine/, @DB;
$detect or print "Error : For the ID $examine NO-Entry could be Found !\n";