1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
|
$MODULE_NAME = "List all Purple:: (and Pidgin::) functions";
use Purple;
# Uncomment this to print the Pidgin:: functions as well.
#use Pidgin;
# All the information Purple gets about our nifty plugin
%PLUGIN_INFO = (
perl_api_version => 2,
name => "Perl: $MODULE_NAME",
version => "0.1",
summary => "Print to standard output all the functions under the Purple:: (and Pidgin::) packages",
description => "Print to standard output all the functions under the Purple:: (and Pidgin::) packages",
author => "Etan Reisner <deryni\@gmail.com>",
url => "http://sourceforge.net/users/deryni9/",
id => "functionlist",
load => "plugin_load",
unload => "plugin_unload"
);
sub plugin_init {
return %PLUGIN_INFO;
}
sub print_array {
my $array = shift;
my @arr = sort @$array;
foreach $mod (@arr) {
my @sub;
foreach $key (sort keys %{$mod}) {
if ($key =~ /::$/) {
push @sub, "$mod$key";
} else {
print "$mod$key\n";
}
}
print_array(\@sub);
}
}
sub plugin_load {
my $plugin = shift;
my @purplearray;
my @pidginarray;
foreach $key (sort keys %Purple::) {
if ($key =~ /::$/) {
push @purplearray, "Purple::$key";
} else {
print "Purple::$key\n";
}
}
print_array(\@purplearray);
foreach $key (sort keys %Pidgin::) {
if ($key =~ /::$/) {
push @pidginarray, "Pidgin::$key";
} else {
print "Pidgin::$key\n";
}
}
print_array(\@pidginarray);
}
sub plugin_unload {
my $plugin = shift;
}
|