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?
LVL 2
itniflAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

nemws1Database AdministratorCommented:
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.
0
lwadwellCommented:
I agree with nemws1 - I am not aware of any automated way.  Begs the question of why?  I have had programs like that too from time to time (much to my dismay) ... but I use Notepad++ AND the 'Function List' plugin - it gives me a list of all of the subroutines in a side window that is a) sortable and b) allows a double click to move to that sub directly.  I find this useful. I am sure other editors probably have similar functionality.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
farzanjCommented:
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.

0
itniflAuthor Commented:
I have been using Notepad++
0
itniflAuthor Commented:
I will go for Notepad++ 's Function List addin, thanks :)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Perl

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.