On Wed, 01 Mar 2023 09:04:15 -0000, Christian Ehrhardt wrote: > This looks wrong to be added to main in 2023. I mean this package clearly > states "This is an obsolete module provided for compatibility since it is > being > removed from the core. For perl 5.10 and above the "given/when" builtins > are much preferred." > Perl 5.10 was in Ubuntu since intrepid, that is 13 years ago. > New code should just use [1] … > [1]: https://www.geeksforgeeks.org/perl-given-when-statement/
Quick additional info: I agree that using the old Switch module has a bad smell; but what the old documentation of the old Switch module doesn't know is that reccommending given/when is also problematic, as this (and more importantly the underlying smartmatch feature) are deprecated and will be removed from perl. Timeline: - After years of discussions, the deprecation has landed in git recently: https://github.com/Perl/perl5/commit/ac8ba642ae7dadc7f3491e13148b8d1c45b84649 and the commits around it - This most probably will show up as new warnings in 5.37.10 (March 2023, dev release) and 5.38.0 (May 2023, next release). - Removal is currently planned for 5.42.0 (May 2025). So starting to use given/when now is not really future-proof … Currently there's no good way to write switch/case statements in Perl (although there's hope that something will appear in perl core in the future, maybe built on the experimental https://metacpan.org/pod/Syntax::Keyword::Match ) … The safest way is probably to go back to if/elsif/else … Some more links: https://blogs.perl.org/mt/mt-search.cgi?limit=20&search=smartmatch https://www.nntp.perl.org/group/perl.perl5.porters/2022/12/msg265180.html https://leonerds-code.blogspot.com/2022/06/a-troubling-thought-smartmatch.html Cheers, gregor, Debian Perl Group -- .''`. https://info.comodo.priv.at -- Debian Developer https://www.debian.org : :' : OpenPGP fingerprint D1E1 316E 93A7 60A8 104D 85FA BB3A 6801 8649 AA06 `. `' Member VIBE!AT & SPI Inc. -- Supporter Free Software Foundation Europe `- -- You received this bug notification because you are a member of Debian Perl Group, which is subscribed to libdigest-md5-file-perl in Ubuntu. https://bugs.launchpad.net/bugs/2007279 Title: [MIR] libdigest-md5-file-perl & libswitch-perl (dependency of devscripts) To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/devscripts/+bug/2007279/+subscriptions _______________________________________________ Mailing list: https://launchpad.net/~pkg-perl-maintainers Post to : [email protected] Unsubscribe : https://launchpad.net/~pkg-perl-maintainers More help : https://help.launchpad.net/ListHelp

