The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Perl::Critic::Policy::ValuesAndExpressions::RequireNumberSeparators

DESCRIPTION

Long numbers are be hard to read. To improve legibility, Perl allows numbers to be split into groups of digits separated by underscores. This policy requires numbers sequences of more than three digits to be separated.

 $long_int = 123456789;   #not ok
 $long_int = 123_456_789; #ok

 $long_float = 1234.56789;   #not ok
 $long_float = 1_234.567_89; #ok

NOTES

As it is currently written, this policy only works properly with decimal (base 10) numbers. And it is obviouly biased toward Western notation. I'll try and address those issues in the future.

AUTHOR

Jeffrey Ryan Thalhammer <thaljef@cpan.org>

Copyright (c) 2005 Jeffrey Ryan Thalhammer. All rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of this license can be found in the LICENSE file included with this module.