Link to home
Start Free TrialLog in
Avatar of itnifl
itniflFlag for Norway

asked on

Sortign sub routines or functions in source code or scripts

I have plenty of sub routines defined in my perl script, they are all in random order. I want them sorted alphabetically. Is there any automatic way to get this done?
Avatar of Nem Schlecht
Nem Schlecht
Flag of United States of America image

Not easily via perl.  It may be a feature of whatever text editor to use, but I doubt it (I don't recall this feature in either Notepad++ or Textmate).

The best recommendation I can come up with is to move the subroutines into a library and sort them as you go.  Not ideal, I know, but better than just leaving them be the way they are now.
ASKER CERTIFIED SOLUTION
Avatar of Lee Wadwell
Lee Wadwell
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Do you mean in editor?
What IDE/Editor are you using?

The whole sub or just its prototypes.  Sorting just the prototypes would be extremely easy using vi.

Avatar of itnifl

ASKER

I have been using Notepad++
Avatar of itnifl

ASKER

I will go for Notepad++ 's Function List addin, thanks :)