P is for Practical | |
PerlMonks |
Re^4: Printing POD info to terminal window without exitingby haukex (Archbishop) |
on Aug 08, 2021 at 18:28 UTC ( [id://11135703]=note: print w/replies, xml ) | Need Help?? |
Pod::Usage seems to rely on underlying "formatters", including perldoc. What's your point here? If you think Pod::Usage is running an external command, you're mistaken. Oversimplifying a bit, the family of Pod::* modules in the core do use each other, so that Pod::Usage and Pod::Perldoc can use the same parser and formatters (see Pod::Simple), but when just converting some POD to text there is no need to call external commands. Explain to me your objection. ... Does your object rely simply on ... I already named almost all of my objections to your suggestion, and so I feel I might be being trolled, but for the sake of explanation: system(qq{perldoc $0});
Add to that the facts that calling an external program is fairly wasteful and that the solution was already found using modules that have been in the Perl core for over 20 years, that rounds out the reasons why I objected. Remember that this is all in the context of providing help to others, so if you've been using this in your own code then you're free to do so, but it's not something I would recommend to anyone else. perldoc is just a Perl script, and here you said: I swear, "shelling-out" to actual Perl scripts from a Perl script is one of the most offensive things I can see in Perl code. All the wasted cycles, dead electrons, PIDs, (oh the horror!) and server fan RPMs that are consumed for no reason
In Section
Seekers of Perl Wisdom
|
|