Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Helper script to format code and output to perlmonks markupby LanX (Saint) |
on Apr 04, 2021 at 21:03 UTC ( [id://11130822]=monkdiscuss: print w/replies, xml ) | Need Help?? |
Hi It's really tedious to need to correct code and example output after spotting a flaw. That's why I just hacked PM.pl to automatically wrap code-tags around my combined source-file and output, so I just need one copy and paste. Just put it into the same directory like your other scripts. Activate it just with do "./PM.pl" inside your source file. It requires a __DATA__ at the end of your source code and will warn you otherwise NB: The do PM.pl; is omitted as is __DATA__ if it's the last line.
DEMO:This
creates
which renders as
OUTPUT:
PM.plThe code is pretty self explanatory, you can adjust it to your needs
UPDATE: fixed localization of non-buffering
Cheers Rolf
Back to
Perl Monks Discussion
|
|