One way I found is to check if the Perl Debugger is "loaded" by checking for defined($DB::single) and assuming Komodo is active, if $DB::single is defined..
But this might also mean the script is legitimately running as perl -d under the "standalone" debugger.
#!/usr/local/ActivePerl-5.10/bin/perl
use strict;
use warnings;
use feature qw/say switch/;
# detect debugger ..
SayDebugerStatus();
sub SayDebugerStatus {
print "Debugger ";
given ($DB::single) {
when (undef) {
say "not loaded.";
}
when (0) {
say "loaded but inactive";
}
default {
say "loaded and active";
}
}
return defined($DB::single) ? 1:0;
}
zakovyrya's suggestion leads to:
if ( grep( /.*Komodo\ IDE\.app/g, values %INC) ){
say "Komodo is running"
} else {
say "Komodo is not running"
};
But is there another way?
UPDATE today my isKomodo() routine failed. Some investigation showed, that IT changed my global path settings from "long" to "short" names (this is under Windows) .. there nolonger is a "KOMODO" string in the %INC hash..
I'm looking for a replacement.