in reply to Re^3: Printing POD info to terminal window without exiting
in thread Printing POD info to terminal window without exiting

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

Replies are listed 'Best First'.
Re^5: Printing POD info to terminal window without exiting
by perlfan (Parson) on Aug 09, 2021 at 01:42 UTC
    I am not trolling you, and I appreciate the thorough explanation. Regarding my quote (the recall of which is quite impressive) is predicated on the fact that one has control of the scripts themselves. However, your point's well taken. You're time's been well spent, if you consider the that you've convinced me to reconsider my original suggestion. I won't stop doing that in a pinch (I suppose until I understand the alternative more clearly), but I will give pause next time I write at tool (which is often).