Ticket #531 (closed enhancement: fixed)
extract subroutine
| Reported by: | rhebus | Owned by: | rhebus |
|---|---|---|---|
| Priority: | major | Milestone: | Satisfy all the requirements of PerlMonks |
| Component: | Refactoring Perl 5 | Version: | 0.45 |
| Keywords: | Cc: |
Description
Brief description here: http://www.eigenstate.net/perl_tools/#Extract_SubroutineMethod
Could use Devel::Refactor to help with this
Attachments
Change History
comment:2 Changed 4 years ago by rhebus
I've attached a patch which provides rudimentary extract subroutine functionality. Problems remaining:
- The new subroutine always goes to the end of the file. Is there a more sensible place to put it? (Answer: yes.)
- There is no attempt to check for errors if Devel::Refactor::extract_subroutine fails. These errors can end as comments in code.
Having said that, when it works, it works great :)
comment:3 Changed 4 years ago by Sewi
Patch applied.
It should be changed to insert the new sub before the 1; if there is nothing than =pod.*=cut behind it.
rhebus, fix it, if you want, otherwise please close the ticket.
Note: See
TracTickets for help on using
tickets.
