It's not exactly what you want, but Microsoft CODE has View: Split Editor (Ctrl+\) and in the second view you can fold all, and when you click on "sub", the side scrollbar shows extra markers where that keyword is, effectively showing you the relative position of the subroutines and how many there are.

A poor man's implementation would be to split up your perlscript on /^sub (\w+)/ and make different files out of those, and have a script that reassembles them back. The problem in Perl is that you can predefine, post-define and embed subroutines, so it has to be a real parser to do that... but you can circumvent this by using perltidy on the source first, so that, once you encounter /^sub.*/ all you need to do is write to a new subroutine file until you reach a solitary /^}$/ and you go back to main. Then open all these files in an editor that can remember a session (like notepad++, Kate, code, sublime, etc). Then, before running you file, you have a cmd/sh file that concats the files and voila...

Not sure if this splitter works on Windows:

#!/usr/bin/perl use File::Basename qw(fileparse fileparse_set_fstype); use autodie qw(open close); $fn = shift; my $type = fileparse_set_fstype(); # save old type fileparse_set_fstype("Unix") unless $type eq "Unix"; # set to unix typ +e my @T = fileparse($fn,'\.[^\.]*$'); #base, path, ext fileparse_set_fstype($type) unless $type eq "Unix"; # restore $filebase = $T[1] . $T[0]; $filename = $filebase . '.main'; open(FI,'<', $fn); open(FO,'>', $filename); while(<FI>){ if(/^sub (\w+)/){ close(FO); $filename = $filebase . '.'. $1; open(FO,'>', $filename); print FO "\n" . $_; }elsif(/^}$/ && $filename ne $filebase . '.main'){ print FO $_; close(FO); $filename = $filebase . '.main'; open(FO,'>>', $filename); }else{ print FO $_; } }

Edit: Oh, forgot: Notepad++ has a Function list that lists all the subroutines. (View -> Function List) So you can combine that with Splitview (rightclick on the tab, then "Clone to other View"). And so, to go to a sub, you click inside the middle pl file, then doubleclick on the right side on any subroutine name, then click on the leftmost pl file that has your edit session. It also has bookmarks on the you can set in every line and rotate through them with (shift) F2

Edit2: updated code (dumb to print $1 and $2 while whole line is still available in $_)


In reply to Re: Any smart Perl editors? by FreeBeerReekingMonk
in thread Any smart Perl editors? by harangzsolt33

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.