You must quote the dollar sign in the qx literal so that perl does not interpret it.
Updates: The other mistake is that you don't remove the newline so "$status" eq "stopped" won't ever be true. But you should probably test for the service running anyway, not for it being stopped. And it might be easier to use a regex match instead of a string equality.
I wouldn't use awk either. (It just causes unnecessary problems with quoting interacting with ssh here.) (No it doesn't, because the pipeline is not passed through ssh but ran in the local shell. Sorry.) Just run the init script and match the output with a perl regex, such as
my $status = qx{ssh r01mn1 /etc/init.d/hadoop-0.20-mapreduce-jobtracke
+r status};
if ( "$status" !~ /\brunning\b/ )
{
print "JOBTRACKER SERVICE is not running\n";
}
Btw, I kept running to interpolation mistakes with $1 when writing perl scripts driving gnuplot, because I'm both interpolating values computed in perl to the gnuplot commands and passing literal $1 thingies that gnuplot interprets as column number expressions.