<chant>without code samples it's hard to say </chant>
That said, Program B likely expects an argument to the -t switch, and is using filetoprocess for that.
Check that -t requires no additional arguments that would gobble up the filetoprocess argument.
The described behavior would happen if you had a <> in your program somewhere,
and in ProgramB.cgi you were shifting off two elements of @ARGV based on the -t switch.
Comment on Re: Running Perl program using backquotes