Hello
I am a perl newbie so please bare with me!!!.
I have some code that starts an external program and i redirect the output to a text file
code:
system('ccm start /d \\\chil\ccmdb\billdemo /n bill /pw billly /nogui /m > debug.txt');
open(be,"debug.txt"
;
@messages=<be>;
This is some of that file-
CM Synergy server starting on host chil, using database \\chil\ccmdb\billdemo
Now I want to be able to strip out "database" and the database name and maybe print it in a file or to the console.
Ive tried this code but it doesnt work-
code:
foreach $cr(@messages){
chomp($cr);
#print "this is arse $cr";
$cr =~ /database\s(.+?)\s/;
#$messages =~/database/;
$database = "$1";
print($cr);
print "this DATABASE $database";
# weed out comments
}
Any ideas?
Cheers
I am a perl newbie so please bare with me!!!.
I have some code that starts an external program and i redirect the output to a text file
code:
system('ccm start /d \\\chil\ccmdb\billdemo /n bill /pw billly /nogui /m > debug.txt');
open(be,"debug.txt"
@messages=<be>;
This is some of that file-
CM Synergy server starting on host chil, using database \\chil\ccmdb\billdemo
Now I want to be able to strip out "database" and the database name and maybe print it in a file or to the console.
Ive tried this code but it doesnt work-
code:
foreach $cr(@messages){
chomp($cr);
#print "this is arse $cr";
$cr =~ /database\s(.+?)\s/;
#$messages =~/database/;
$database = "$1";
print($cr);
print "this DATABASE $database";
# weed out comments
}
Any ideas?
Cheers