Perl::Critic::Policy::BuiltinFunctions::ProhibitSleepViaSelect - Use L instead of something like C.


Perl-Critic documentation  | view source Contained in the Perl-Critic distribution.

Index


NAME

Top

Perl::Critic::Policy::BuiltinFunctions::ProhibitSleepViaSelect - Use Time::HiRes instead of something like select(undef, undef, undef, .05).

AFFILIATION

Top

This Policy is part of the core Perl::Critic distribution.

DESCRIPTION

Top

Conway discourages the use of select() for performing non-integer sleeps. Although documented in perlfunc (perlfunc), it's something that generally requires the reader to read perldoc -f select to figure out what it should be doing. Instead, Conway recommends that you use the Time::HiRes module when you want to sleep.

    select undef, undef, undef, 0.25;         # not ok

    use Time::HiRes;
    sleep( 0.25 );                            # ok




CONFIGURATION

Top

This Policy is not configurable except for the standard options.

SEE ALSO

Top

Time::HiRes.

AUTHOR

Top

Graham TerMarsch <graham@howlingfrog.com>

COPYRIGHT

Top


Perl-Critic documentation  | view source Contained in the Perl-Critic distribution.