There are two things that might be issues here. First, with the single-quoted string, the variable is not expanded, so the
system() call sees the literal string
procheck $proc 2.0. Since it contains a character special to the shell (the
$), Perl runs the command through the shell, so the shell gets a chance to expand that. Unless your environment contains the variable
proc, that will expand to nothing. But that doesn't matter much, since the shell can't even seem to find the program
procheck in the
PATH. It complains about that.
If we change the quotes to double-quotes, the variable gets expanded by Perl (which is probably what you want, since you're using that variable in the loop). But then you're likely get a warning from Perl about not being able to find
The solution to that is to give the full path to the program, or make sure it's in the scripts
Though if running it on an interactive shell works, it's possible that
procheck is actually an alias or a function. If it's just a regular executable, it would be in the
PATH, which should be inherited to Perl and the subshell. In e.g. Bash, you could use
type -a procheck to see what it actually runs and if there are other alternatives, like a disk file masked behind an alias.
Oh, also, if you don't need the shell when running the command, you can prevent Perl from even accidentally calling it by using the list form of
system and giving the arguments to the command as separate arguments to
system. Here, that would be
system("procheck", $proc, "2.0").