list_cats.pl

来自「opennms得相关源码 请大家看看」· PL 代码 · 共 28 行

PL
28
字号
#!@install.perl.bin@ -wuse strict;my $xml_data_file = shift(@ARGV) or die "no file given!\n";my @targets;my $lookin = 1;open (FILEIN, $xml_data_file) or die "unable to open $xml_data_file for reading: $!\n";while (<FILEIN>) {	if ($lookin) {                $lookin = 0 if (/<name>[Aa]vailability<\/name>/i);		next;	}	$lookin = 1 if (/<\/view>/);        if (/<label>(<\!\[CDATA\[)?([a-z&; ]+)(\]\]>)?<\/label>/i) {                my $category=$2;                $category =~ s/\&amp;/\&/g;                $category =~ s/\&quot;/"/g;                $category =~ s/\&apos;/'/g;                push (@targets, $category);	}}close (FILEIN);for (@targets) {	print $_, "\n";}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?