in reply to Re^2: Code Statements/Lines per Function Point
in thread Code Statements/Lines per Function Point

You might be able to count something not unlike function points using some clever hackery with one of the B:: modules, eg:

perl -MO=Concise my_script | wc -l

If you analyze the results this gives for some simple examples, you may well find that this gives a roughly consistent number of opcodes per function point that you could use for your metrics.

There are some types of information you will lose when doing this though, for example any pattern match will give a single opcode however complex it is (excluding embedded perl code).

You may also want to grep out some of the less useful nodes before counting, eg some or all of qw/ null lineseq nextstate pushmark unstack enter leave const /.

Hugo