NAME

Egg::Plugin::Tools - Various function collections.

SYNOPSIS

  use Egg qw/ Tools /;

  $e->escape_html($html);
  
  $e->unescape_html($plain);
  
  $e->md5_hex('abcdefg');
  
  $e->comma('12345.123');
  
  my @array= (1..100);
  $e->shuffle_array(\@array);

DESCRIPTION

This plugin offers the method of various functions.

METHODS

encode_entities ( [HTML_TEXT], [ARGS] )

The result of HTML::Entities::encode_entities is returned.

  • Alias: escape_html, eHTML

encode_entities_numeric ( [HTML_TEXT], [ARGS] )

The result of HTML::Entities::encode_entities_numeric is returned.

decode_entities ( [PLAIN_TEXT], [ARGS] )

The result of HTML::Entities::decode_entities is returned.

  • Alias: unescape_html, ueHTML

uri_escape ( [URI_PARTS], [ARGS] )

The result of URI::Escape::uri_escape is returned.

  • Alias: escape_uri, eURI

uri_escape_utf8 ( [URI_PARTS], [ARGS] )

The result of URI::Escape::uri_escape_utf8 is returned.

uri_unescape ( [URI], [ARGS] )

The result of URI::Escape::uri_unescape is returned.

  • Alias: unescape_uri, ueURI

call ( [PACKAGE_NAME], [METHOD_NAME], [ARGS] )

PACKAGE_NAME is read, and METHOD_NAME is called.

Please give PACKAGE_NAME the module name since the project name.

$e and ARGS are passed to METHOD_NAME.

  # MyApp::AnyPkg->call_method($e, ... args ); is done.
  my $result= $e->call( AnyPkg => 'call_method', .... args );

md5_hex ( [DATA] )

The result of Digest::MD5::md5_hex is returned.

comma ( [NUMBER] )

Is put in given NUMBER in each treble and it returns it.

  $e->comma('123456')       =>    123,456
  $e->comma('-654321.123')  =>   -654,321.123
  $e->comma('+123456789.0') => +1,234,567.0

shuffle_array ( [ARRAY] )

It returns it mixing given ARRAY at random.

  my @array= (1..10);
  $e->shuffle_array(\@array);

* Quotation from perlfaq.

filefind ( [FIND_REGIX], [SEARCH_DIR_ARRAY] )

File::Find is done and the result is returned by the ARRAY reference.

  my $files= $e->filefind(qr{\.pm$}, qw( /usr/lib/perl5/... ))
          || return 0;

SEE ALSO

HTML::Entities, URI::Escape, Digest::MD5, Egg::Release,

AUTHOR

Masatoshi Mizuno <lushe@cpan.org>

COPYRIGHT

Copyright (C) 2007 by Bee Flag, Corp. <http://egg.bomcity.com/>, All Rights Reserved.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.6 or, at your option, any later version of Perl 5 you may have available.