aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--history-search/rl_history_search.pl10
-rw-r--r--ido-mode/ido_switcher.pl12
-rw-r--r--prompt_info/uberprompt.pl10
-rw-r--r--scrolled-reminder/scrolled_reminder.pl8
-rw-r--r--vim-mode/vim_mode.pl8
5 files changed, 9 insertions, 39 deletions
diff --git a/history-search/rl_history_search.pl b/history-search/rl_history_search.pl
index ca45fe5..642b99c 100644
--- a/history-search/rl_history_search.pl
+++ b/history-search/rl_history_search.pl
@@ -81,13 +81,7 @@ sub DEBUG () { $DEBUG_ENABLED }
# check we have uberprompt loaded.
sub script_is_loaded {
- my $name = shift;
- print "Checking if $name is loaded" if DEBUG;
- no strict 'refs';
- my $retval = defined %{ "Irssi::Script::${name}::" };
- use strict 'refs';
-
- return $retval;
+ return exists($Irssi::Script::{shift . '::'}) ;
}
if (not script_is_loaded('uberprompt')) {
@@ -103,7 +97,7 @@ if (not script_is_loaded('uberprompt')) {
}
history_init();
} else {
- history_init();
+ history_init();
}
sub load_uberprompt_failed {
diff --git a/ido-mode/ido_switcher.pl b/ido-mode/ido_switcher.pl
index 91da08b..e5c5447 100644
--- a/ido-mode/ido_switcher.pl
+++ b/ido-mode/ido_switcher.pl
@@ -250,15 +250,9 @@ sub print_all_matches {
#_print("Longtest name: $longest_name");
}
- sub script_is_loaded {
- my $name = shift;
- _debug_print "Checking if $name is loaded";
- no strict 'refs';
- my $retval = defined %{ "Irssi::Script::${name}::" };
- use strict 'refs';
-
- return $retval;
- }
+sub script_is_loaded {
+ return exists($Irssi::Script::{shift . '::'});
+}
unless (script_is_loaded('uberprompt')) {
diff --git a/prompt_info/uberprompt.pl b/prompt_info/uberprompt.pl
index 37c3c81..3426711 100644
--- a/prompt_info/uberprompt.pl
+++ b/prompt_info/uberprompt.pl
@@ -100,13 +100,7 @@
# # check we have uberprompt loaded.
#
# sub script_is_loaded {
-# my $name = shift;
-# print "Checking if $name is loaded" if DEBUG;
-# no strict 'refs';
-# my $retval = defined %{ "Irssi::Script::${name}::" };
-# use strict 'refs';
-#
-# return $retval;
+# return exists($Irssi::Script::{shift . '::'});
# }
#
# if (not script_is_loaded('uberprompt')) {
@@ -122,7 +116,7 @@
# }
# app_init();
# } else {
-# app_init();
+# app_init();
# }
#
# sub load_uberprompt_failed {
diff --git a/scrolled-reminder/scrolled_reminder.pl b/scrolled-reminder/scrolled_reminder.pl
index 48da622..21fab26 100644
--- a/scrolled-reminder/scrolled_reminder.pl
+++ b/scrolled-reminder/scrolled_reminder.pl
@@ -82,13 +82,7 @@ our %IRSSI =
# check we have prompt_info loaded.
sub script_is_loaded {
- my $name = shift;
- print "Checking if $name is loaded" if DEBUG;
- no strict 'refs';
- my $retval = defined %{ "Irssi::Script::${name}::" };
- use strict 'refs';
-
- return $retval;
+ return exists($Irssi::Script::{shift . '::'}) ;
}
unless (script_is_loaded('uberprompt')) {
diff --git a/vim-mode/vim_mode.pl b/vim-mode/vim_mode.pl
index 551fbb6..2916ca9 100644
--- a/vim-mode/vim_mode.pl
+++ b/vim-mode/vim_mode.pl
@@ -615,13 +615,7 @@ my $completion_active = 0;
my $completion_string = '';
sub script_is_loaded {
- my $name = shift;
- print "Checking if $name is loaded" if DEBUG;
- no strict 'refs';
- my $retval = %{ "Irssi::Script::${name}::" };
- use strict 'refs';
-
- return $retval;
+ return exists($Irssi::Script::{shift . '::'});
}
vim_mode_init();