Perl::...Select(3pm)

πŸŽ€ NAME πŸŽ€

okay bestie, welcome to Perl::...Select(3pm) in the User Contributed Perl Documentation manual πŸ’…. This policy is literally Perl::Critic::Policy::BuiltinFunctions::ProhibitSleepViaSelect, and it's giving: use Time::HiRes instead of something like select(undef, undef, undef, .05) 🫢.

🌸 AFFILIATION 🌸

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

πŸ’– DESCRIPTION πŸ’–

so Conway discourages the use of select() for performing non-integer sleeps 😭. Even though it's documented in 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 πŸŽ€

This Policy is not configurable except for the standard options πŸ’…. That's the whole story.

πŸ¦‹ SEE ALSO πŸ¦‹

Time::HiRes β€” go peek πŸ‘€.

🌈 AUTHOR 🌈

Graham TerMarsch <graham@howlingfrog.com> πŸ’–

Copyright (c) 2005-2011 Graham TerMarsch. All rights reserved. πŸŽ€

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. ✨


okay that's the whole vibe check, bestie πŸ’– source/version: perl v5.42.0; date: 2024-10-23 πŸŽ€βœ¨

πŸ“¦ where this page comes from