Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Re: Parsing by indentationby atcroft (Abbot) |
on Oct 24, 2018 at 20:18 UTC ( [id://1224612]=note: print w/replies, xml ) | Need Help?? |
Some time back I had to do something similar. While I am not able to pull example code at the moment, what I did was basically the following:
I then processed the array of entries using the ( number of leading spaces / GCF ) value to determine indentation level. For the example configuration you show, the indentation would show as the following:
Because I was potentially looking at multiple indentation levels, I believe I did something like the following to get the common indentation width:
This resulted in a common indentation factor of 2, which agrees with the observed. Hope that helps.
In Section
Seekers of Perl Wisdom
|
|