The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Test::PureASCII - Test that only ASCII characteres are used on your code

SYNOPSIS

  use Test::PureASCII;
  all_perl_files_are_pure_ascii();

or

  use Test::PureASCII tests => $how_many;
  file_is_pure_ascii($filename1, "only ASCII in $filaname1");
  file_is_pure_ascii($filename2, "only ASCII in $filaname2");
  file_is_pure_ascii($filename3, "only ASCII in $filaname3");
  ...

The usual pure-ASCII test looks like:

  use Test::More;
  eval "use Test::PureASCII";
  plan skip_all => "Test::PureASCII required" if $@;
  all_perl_files_are_pure_ascii();

DESCRIPTION

This module allows to create tests to ensure that only 7-bit ASCII characters are used on Perl source files.

EXPORT

The following functions are exported by this module:

file_is_pure_ascii($filename [, $test_name])

checks that $filename contains only ASCII characters.

The optional argument $test_name will be included on the output when reporting errors.

all_perl_files_are_pure_ascii( [@dirs] )

find all the Perl source files contained in directories @dirs recursively and check that they only contain ASCII characters.

blib is used as the default directory if none is given.

all_files_are_pure_ascii( [@dirs] )

find all the files (Perl and non-Perl) contained in directories @dirs recursively and check that they only contain ASCII characters.

The current directory is used as the default directory if none is given.

SEE ALSO

A nice table containing Unicode and Latin1 codes for common (at least in Europe) non-ASCII characters is available from http://www.alanwood.net/demos/ansi.html.

AUTHOR

Salvador Fañdino, <sfandino@yahoo.com>

COPYRIGHT AND LICENSE

Copyright (C) 2008 by Qindel Formacion y Servicios S.L.

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.8 or, at your option, any later version of Perl 5 you may have available.

This module contains code copied from Test::Pod Copyright (C) 2006 by Andy Lester.