Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

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

Helo,
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:

    https://raw.githubusercontent.com/Yubico/yubikey-val/master/ykval-verify.php

    https://raw.githubusercontent.com/Yubico/yubikey-val/master/ykval-common.php

    https://raw.githubusercontent.com/Yubico/yubikey-val/master/ykval-synclib.php

    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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1109703]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2024-04-20 06:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found