AUBBC

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN

        type     => 3,
        function => 'My_Message::get_some_tag',
        );
  $aubbc->add_build_tag(
        name     => 'hello',
        pattern  => '',
        type     => 4,
        function => 'Hello World!',
        );
  my $message = '[ok://test me] [ok://test other] [ok://n0 w00rk] [ip] [agent] [hello]';

  $message = $aubbc->do_all_ubbc($message);

  print $message;

  sub check_ok_tag {
  my ($tag_name, $text_from_AUBBC) = @_;

   if ($text_from_AUBBC eq 'test me') {
        return 'Works Good 1';
        }
         else {
               return 'Works Good 2';
               }
  }

  sub get_some_tag {
  my ($tag_name, $text_from_AUBBC) = @_;
  $tag_name = lc($tag_name);
  $text_from_AUBBC = $ENV{'REMOTE_ADDR'} if ($tag_name eq 'ip');
  $text_from_AUBBC = $aubbc->script_escape($ENV{'HTTP_USER_AGENT'}) if ($tag_name eq 'agent');
  return $text_from_AUBBC;
  }

  1;

=head2 $aubbc->remove_build_tag($name, $option);

There are two ways to use this.

1) Remove a single built tag: $aubbc->remove_build_tag($name);

2) Remove all built tags: $aubbc->remove_build_tag('', 1);

=head1 Error Message

=head2 $AUBBC::BAD_MESSAGE

Default message is 'Unathorized', this message is used when the code finds bad characters in [email] or [img] tags.

Usage of this setting:

  use AUBBC;
  $AUBBC::BAD_MESSAGE = 'Unauthorized use of characters or pattern in this tag.';
  # est...

=head2 $aubbc->aubbc_error();

There are two errors for add_build_tag that would die if the wrong input was given
when adding a build tag. The error message will now be stored in this method during
the instance and any new tag that had an error will not be processed.

Since there is only two errors for add_build_tag you can check this method after
all new tags have been added. All errors stack in this method and are seperaited
by a \n newline.

Usage:

        $aubbc->aubbc_error('Insert Your Error'); # Add an error

        print $aubbc->aubbc_error();

        die $aubbc->aubbc_error() if $aubbc->aubbc_error();

=head1 Memoize

This setting can turn AUBBC's usage of Memoize on or off.

=head2 $AUBBC::MEMOIZE

Default setting 1 will check if it needs to load Memoize, if loaded then load the sub's that need the speed.

Setting 0 will not use Memoize.

Usage of this setting:

  use Memoize;
  # do other stuff...

  use AUBBC;

  # AUBBC will detect that Memoize was loaded
  # and just load the sub's that need the speed.
  my $aubbc = AUBBC->new();

  # est...

=head1 Debug

The Debug setting will send a lot of messages to warn and is not recommended to leave on all the time.

=head2 $AUBBC::DEBUG_AUBBC

Default is '' off, and Enabled is 1.

Usage of this setting:

  use AUBBC;
  $AUBBC::DEBUG_AUBBC = 1;
  # est...

=head1 Version

Returns the current version of the module.

=head2 $aubbc->version();


 Usage:

  use AUBBC;



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