Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

Re: Using perl for refactoring

by pajout (Curate)
on Dec 09, 2014 at 11:10 UTC ( [id://1109703] : note . print w/replies, xml ) Need Help??

in reply to Using perl for refactoring

would you be more specific, for instance, would you provide some minimal example?

I can imagine you want to get oriented graph, describing which file (module, library) uses something from which file. Or, seeing something like $instance->method(), you want to know in which module is method implemented - this second example is not generally solvable, coz it may depend on some input parameters and is resolved in runtime.

Replies are listed 'Best First'.
Re^2: Using perl for refactoring
by OceanPerl (Initiate) on Dec 09, 2014 at 12:21 UTC

    Hi Pajout

    Of course. The code I'm faced with is PHP, but I think Perl is probably more suited to the tasks such as this where text parsing is involved, hence the post here.

    The code I am looking at refactoring for a specific application is published open-source by Yubikey on Github, so the relevant files are as follows:

    So synclib and common are the libraries, and verify is the main file.

      Wait! As fare as i understood you, you want to refactor PHP code using Perl, right?

      If so please:

      Regards, Karl

      «The Crux of the Biscuit is the Apostrophe»

      ...thanks. And, what output of that perl software do you expect?
Re^2: Using perl for refactoring
by Anonymous Monk on Dec 09, 2014 at 11:35 UTC

    Darn thing (searching for methods) is even more harder when a method name is a variable, possibly formed partially. Similarly problem is when subs are produced en masse or via AUTOLOAD.