Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^2: Pretty Print (perltidy integration)

by LanX (Archbishop)
on Sep 17, 2017 at 21:40 UTC ( #1199567=note: print w/replies, xml ) Need Help??


in reply to Re: Pretty Print (perltidy integration)
in thread Pretty Print

> B) perltidy can also produce highlighted code, but startup is slow and would cause a lag

> C) patching perltidy to run in a server mode might be a solution.

FWIW:

Actually no patch needed, this code from Perl::Tidy is very fast after initialization (which can take 1-2 secs)

use Perl::Tidy; # ... # run in a loop reading source and outputting dest my $error = Perl::Tidy::perltidy( argv => $argv, source => \$source_string, destination => \$dest_string, stderr => \$stderr_string, errorfile => \$errorfile_string, + );

Indenting some lines on laptop took under 0.05 sec and own formatters for "special" html are easily implemented.

(trying to implement a so called "asynchronous process" interface for emacs now)

Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Je suis Charlie!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1199567]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2019-11-18 08:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Strict and warnings: which comes first?



    Results (88 votes). Check out past polls.

    Notices?