Hi Hauke,
Thanks a lot for quick response !! Your response really helped.
I am actually writing few perl codes for the first time for a project and want to be cautious with use of such modules. Is there any way I can get to know those basic modules whose use is not suggested?
Thanks once again for your help!!
--
Abhishek | [reply] |
Hi Abhishek,
Modules whose use is discouraged is often noted in the module's documentation itself (for example, the top of the Switch page says "do not use if you can use given/when"). Otherwise, by looking at a distribution's CPAN page (this is the one for Switch), there are other clues as to when a module might not be good to use: if it has bad reviews, if it only had one release and/or hasn't had releases for many years, if its test statistics show a lot of failures, and/or if it has a lot of unresolved bugs. None of these things by themselves make a module bad, they are only clues, but if a module has a lot of these issues then you may want to stay away from it. The same clues can of course be used to tell if a module is "good": good reviews, several releases over several years, a low bug count, and good test results are all signs of a module being "good quality".
Off the top of my head, some modules that are often used even though their use is nowadays discouraged: XML::Simple (is only useful for a very narrow range of tasks, there are better modules like XML::Twig, XML::Rules, or XML::LibXML), Switch (a few alternatives), and CGI (there are more modern web frameworks, such as Catalyst, Dancer/Dancer2, and Mojolicious). <update> File::Slurp has a lot of issues, better to slurp manually or use one of the other modules. </update>
On the other hand, you can get a lot of good module suggestions from this site itself by reading threads with questions that relate to your tasks, or there is also Task::Kensho, a list of recommended modules for various tasks.
Hope this helps, -- Hauke D
| [reply] [d/l] [select] |
Hi Hauke,
I am out of words to thank you for your thorough explanation. Though for now I got the problem resolved by avoiding switch module. I will be referring to your response time and again before using any new module.
Thanks a lot !!
Best Regards,
Abhishek
| [reply] |
Thank you, haukex, for this enlightening post.
I doubt that I am alone in wondering why CPAN does not have a better method of finding and marking modules that may be, for lack of a better word, obsolete.
| [reply] |