For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > August 2005 > inbedding batch files in perl scripts









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author inbedding batch files in perl scripts
imfaus

2005-08-05, 11:01 am

I am trying to script a perl program that will stop mysql (on a windows system) apparently I can't simply use a net stop msyql command instead I need to add a line that says use win32; in my perl script and create a function that sends a call to the service control manager to tell it to stop mysl and then it will do that...this seems way to complicated..so I wanted to imbed or call a batch file within my perl program to do just this...but its having some issues...here is the line in question

print "Obtain most recent unixtimestamp in the database\n";
#Obtain most recent unix_timestamp in the database
my $preparequery;
my $sth;
my $myquery0 = 'select now();';
my $sth = $dbh->prepare($myquery0);
$sth->execute();
my @timestamp = $sth->fetchrow_array();
print "the current unix timestamp is: $timestamp[0]\n";
'd:\stopmyql.bat';

I have print statements but it never completes this command...is there a particular syntax I am missing? I am a newbie to perl thanks
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com