Hi Raheel! On Wednesday 19 August 2009 15:59:44 Raheel Hassan wrote: > ---------- Forwarded message ---------- > From: Raheel Hassan <raheel.has...@gmail.com> > Date: Wed, Aug 19, 2009 at 2:48 PM > Subject: This code is not giving the required output. > To: beginners-h...@perl.org > > > Hello, > > I have problems in executing the under given code. I need to restart my > database, apache etc services using on ubuntu machine. for that i have > written thsi code, but the result of the command is not saving in the file > , any suggestions please. > > > my $result = 'service mysql start 2>>/var/log/comm.log';
You probably meant: <<< my $result = `service mysql start 2>>/var/log/comm.log`; >>> With backticks instead. a '...' is just a constant string (with no interpolation). backticks execute a command and return its output. For more information see: http://perldoc.perl.org/perlop.html#Quote-and-Quote-like-Operators Regards, Shlomi Fish -- ----------------------------------------------------------------- Shlomi Fish http://www.shlomifish.org/ Best Introductory Programming Language - http://xrl.us/bjn84 God gave us two eyes and ten fingers so we will type five times as much as we read. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/