sub Check_request_file { # This sproc is a security measure my ($file_to_check) = @_; open (FILE, "<$flat_to_check"); while (){ #SPROC Name: reception if ($_ =~ /SPROC\sName\:/ && $_ !~ /SPROC\sName\:\s[r|R]eception/){ remame "$flat_to_check", "" or warn $!; exit; }else {#Do nothing } } }