Is there a tool that would load a perl module and automatically all its dependencies (i.e. Other perl modules) locally?
I package dependent perl modules locally that I find missing on my development machine, but on production deployment it finds some other sub-modules missing! How to resolve this problem! Regards, Suhas On 8/19/09 6:36 AM, "Raheel Hassan" <[email protected]> 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. > > On Wed, Aug 19, 2009 at 3:24 PM, Chas. Owens <[email protected]> wrote: > >> On Wed, Aug 19, 2009 at 08:59, Raheel Hassan<[email protected]> >> wrote: >> snip >>> written thsi code, but the result of the command is not saving in the >> file , >>> any suggestions please. >> snip >>> my $result = 'service mysql start 2>>/var/log/comm.log'; >> snip >> >> Your are using '' which is the single quoted string (i.e. >> non-interpolating string), you mean to use `` which is the [command >> execution string][1]. I would advise against using backticks for this >> very reason. Use the generalized form instead: qx//. The slashes may >> be replaced with any pair of characters, or in the case of bracketing >> characters, the opposite bracketing character: >> >> my $result = qx{service mysql start 2>>/var/log/comm.log}; >> >> snip >>> if($result =~ /OK/) >> snip >> >> You also may want to use the [word-boundary zero-width assertion >> (\b)][2] to ensure that you are matching the word OK not the substring >> OK in a larger word like LOOK: >> >> if ($result =~ /\bOK\b/) >> >> [1] : http://perldoc.perl.org/perlop.html#Quote-and-Quote-like-Operators >> [2] : http://perldoc.perl.org/perlre.html#Assertions >> >> Chas. Owens >> wonkden.net >> The most important skill a programmer can have is the ability to read. >> --Regards Suhas [Getting stated w/ Grid] http://twiki.corp.yahoo.com/view/GridDocumentation/GridDocAbout [Search HADOOP/PIG Information] http://ucdev20.yst.corp.yahoo.com/griduserportal/griduserportal.php -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] http://learn.perl.org/
