Thanks a lot for your support, it works now i made change in *my $result =~ /[ OK ]/;* and now it works. Because when you run the command *`service mysql start`* it gives output like this [ OK ]. Therefore after making the required changes it works.
Regards to all, On Wed, Aug 19, 2009 at 6:51 PM, Shawn H. Corey <shawnhco...@gmail.com>wrote: > Raheel Hassan wrote: > >> When i am running this command *service mysql start* at command line it >> gives OK but when calling it in perl script it print *$mysqld: >> unrecognized >> service* in the output file. Therefore the variable result gets NOK and it >> prints NOK. This does not work because it should print OK. >> > > How are you calling the script? Is it a CGI? If it is being called under > a different user, there could be a permissions problem. > > > -- > Just my 0.00000002 million dollars worth, > Shawn > > Programming is as much about organization and communication > as it is about coding. > > I like Perl; it's the only language where you can bless your > thingy. >