
| Current Path : /var/www/web-klick.de/dsh/50_dev2017/1300__perllib/Music/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : /var/www/web-klick.de/dsh/50_dev2017/1300__perllib/Music/ServMusicMonitor.pm |
package Application::ServMusicMonitor;
use strict;
sub new {
my $class = shift;
my $self = {};
$self->{'LQH'} = shift;
bless($self,$class);
return($self);
}
#******************************************************************
sub run {
my $self = shift;
my $text = shift;
my $lqh = $self->{'LQH'};
my $o; my $o1; my $o2; my $o3;
print "CMD: $text\n";
my @tt = split(/\s+/," ".$text);
shift(@tt); my $xx;
if ($tt[0] eq "open") {
# my $batchmode = "";
# if ($tt[1] =~ /^(.*?),(.*)/) {
# $batchmode = $2;
# }
my $editmode = 0;
system("cp ".$tt[1]." ".$tt[1]."~");
while (0 == 0) {
if ($editmode) {
system("joe " . $tt[1]);
}
open(FFILE,"<".$tt[1]);
my @tt1 = <FFILE>;
close(FFILE);
if (!$editmode) {
$xx = `pwd`;
chomp($tt1[1]);
$tt1[1] = $tt1[1] . "___PARSED___ " . $xx;
# } else {
# if ($batchmode) {
# foreach $o3 (reverse split(/,/,$batchmode)) {
# next if (!$o3);
# unshift(@tt1,"::".$o3);
# }
# unshift(@tt1,"::wait");
}
$xx = $lqh->do(join("",@tt1));
# if ($batchmode) { $xx = "exit"; }
if ($xx eq "exit") {
open(FFILE,">".$tt[1]);
shift(@tt1);
print FFILE join("",@tt1);
close(FFILE);
return("exit");
}
if ($xx =~ s/^___well-formed___//) {
open(FFILE,">".$tt[1]);
print FFILE $xx;
close(FFILE);
$editmode = 1;
}
}
}
}
#***********************************************************************
1;