ARSperl

 view release on metacpan or  search on metacpan

example/WhoUsesIt.pl  view on Meta::CPAN

} elsif($opt_e) {
    # find any schema that uses this escalation.

    print "Searching for Escalation \"$opt_e\"...\n";

    foreach $schema (@schemas) {
	@escalations = ars_GetListEscalation($ctrl, $schema);
	if(grep(/^$opt_e$/, @escalations)) {
	    $users{$schema} = 1;
	}
    }

    foreach (sort keys %users) {
	print "\t$_\n";
    }

} elsif($opt_p) {
    # find any *filters* that call the named process

    print "Searching for filters that call \"$opt_p\"...\n";

    @filters = ars_GetListFilter($ctrl);
    if($#filters != -1) {
	foreach $filter (@filters) {
	    $finfo = ars_GetFilter($ctrl, $filter);
	    foreach $action (@{$finfo->{actionList}}) {
		if(defined($action->{process})) {
		    print "filter $filter process ".$action->{process}."\n" if $debug;
		    if($action->{process} =~ /$opt_p/) {
			$users{$filter} = $action->{process};
		    }
		}
	    }
	}
	foreach $f (sort keys %users) {
	    if(!$opt_v) {
		print "\t$f\n";
	    } else {
		print "\t$f\n\t\t$users{$f}\n";
	    }
	}
    }

} else {
    print "nothing to do!\n";
}

ars_Logoff($ctrl);

exit 0;

# ROUTINE
#   Usage()
# 
# DESCRIPTION
#   Dump usage information.
#
# AUTHOR
#   jeff murphy

sub Usage {
    print "Usage: $pname [-v] [-h] [-s schema] [-a | -f | -m | -e | -p [name]]\n";
    print "       [username] [password]\n"
}



( run in 0.775 second using v1.01-cache-2.11-cpan-39bf76dae61 )