in reply to Re^2: Program unsuspectingly dies with no reason why.
in thread Program unsuspectingly dies with no reason why. -FIXED!

I think you missed Kyle's point. Using system instead of backticks to call grep should not matter here.

To illustrate Kyle's point, add these lines just before your grep line:

print "removeq = $removeq\n"; print "sourcefile = $sourcefile\n";

I suspect these variables will not contain what you expect them to.