Acme-Text-Shorten-ForTwitter

 view release on metacpan or  search on metacpan

lib/Acme/Text/Shorten/ForTwitter.pm  view on Meta::CPAN

  $shortener->add_rule("name");

  $shortener->add_rule("name", sub { 
    my $text = shift; $$text =~ s/hello/hi/; 
  });

In the first form, adds a named rule from one of the loaded
plugins to the list of rules to use. Will die if the named
rule cannot be found.

In the second form, adds a custom rule. The subroutine should
take a reference to a scalar, and should modify the scalar
as needed.

=head3 remove_rule

  $shortener->remove_rule("name");

Removes the named rule from the shortener. Will die if the named
rule cannot be found.



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