RT 5.0.6 Documentation


Go to latest version →


RT::Shredder::Plugin - interface to access shredder plugins


  use RT::Shredder::Plugin;

  # get list of the plugins
  my %plugins = RT::Shredder::Plugin->List;

  # load plugin by name
  my $plugin = RT::Shredder::Plugin->new;
  my( $status, $msg ) = $plugin->LoadByName( 'Tickets' );
  unless( $status ) {
      print STDERR "Couldn't load plugin 'Tickets': $msg\n";

  # load plugin by preformatted string
  my $plugin = RT::Shredder::Plugin->new;
  my( $status, $msg ) = $plugin->LoadByString( 'Tickets=status,deleted' );
  unless( $status ) {
      print STDERR "Couldn't load plugin: $msg\n";



Object constructor, returns new object. Takes optional hash as arguments, it's not required and this class doesn't use it, but plugins could define some arguments and can handle them after it's been loaded.


Returns hash with names of the available plugins as keys and path to library files as values. Method has no arguments. Can be used as class method too.

Takes optional argument type and leaves in the result hash only plugins of that type.


Takes name of the plugin as first argument, loads plugin, creates new plugin object and re-blesses self into plugin if all steps were successfully finished, then you don't need to create new object for the plugin.

Other arguments are sent to the constructor of the plugin (method new.)

Returns $status and $message. On errors status is false value.

In scalar context, returns $status only.


Takes formatted string as first argument and which is used to load plugin. The format of the string is

  <plugin name>[=<arg>,<val>[;<arg>,<val>]...]

exactly like in the rt-shredder script. All other arguments are sent to the plugins constructor.

Method does the same things as LoadByName, but also checks if the plugin supports arguments and values are correct, so you can Run specified plugin immediately.

Returns list with $status and $message. On errors status is false.


Instance method that takes one object as argument and re-bless the current object into into class of the argument and copy data of the former. Returns nothing.

Method is used by Load* methods to automatically re-bless RT::Shredder::Plugin object into class of the loaded plugin.

← Back to index