perl with two files and print

Suppose u have two files

one file
>hi|23433|sp|he is RAJ<space>>hi|23333|df|He is HUMAN<space>>hi|222|gi|howru|just
WOWHEISWONDERFUL
>hi|25559|gs|heisANUJ<space>>hi|2232|sp|he is fool
SKSIKSIKSLKSSLLS

Another file
HUMAN

so output wil be ...if the list contain HUMAN only take it as shown:
HUMAN hi|23433|sp|he is RAJ

#! /usr/bin/perl -w

open(FILE,"$ARGV[0]") or die;
my @temp=<FILE>;
close FILE;

my $f=join("",@temp);
$f=~s/^>gi/ronaldo/g;
my @reco=split("ronaldo",$f);
my $dis=shift(@reco);
pen(FILE,"$ARGV[1]") or die;
my @temp1=<FILE>;
close FILE;

if($reco =~ /$temp1/)
{
print "YES";
}
else {
print "NO??????\n\n";
exit;
}

it is not gud perlscript only it will print either YES or NO
?
Whta can be possible solution

$ 
$ cat f1
>hi|23433|sp|he is RAJ >hi|23333|df|He is HUMAN >hi|222|gi|howru|just
WOWHEISWONDERFUL
>hi|25559|gs|heisANUJ >hi|2232|sp|he is fool
SKSIKSIKSLKSSLLS
$ 
$ cat f2
HUMAN
$ 
$ perl -ne 'BEGIN{open(F2,"f2");chomp($x=<F2>);close(F2)}{print $x," ",substr($_,1,index($_,">hi",1)-1),"\n" if /$x/}' f1
HUMAN hi|23433|sp|he is RAJ 
$ 

tyler_durden