i think the inner block would be much clearer and short as something like this (note also that $a and $b should be avoided because of their use by sort):
foreach (@FILE_ARRAY){ next unless /^(?:([0-9_a-zA-Z*]+) +)?(?:([0-9_a-zA-Z*]+) +)?(?:([0-9 +_a-zA-Z*]+) +)?([0-9_a-zA-Z*]+)\((.+?)\)/; my ($args, @definition) = map { defined($_)?$_:'' } $5, $1, $2, $3, +$3; print join(" ", @definition) . " ARGS: $args\n"; }

This only works with parsing one row
To workaround this, you need to slurp in either the whole file, or maybe just one function (maybe defined by /^}$/ ?? not going to be 100%) at a time.. Then your regex can use the /s modifier and span multiple lines and you'll want to change all the spaces in the regex to \s+

Later Im gonna add for parsing Perl scripts aswell, but that is alot easier.
easier? really? There is PPI, but there's set way to pass parameters into a function ... e.g.
sub foo { my $self = shift; my $p = {@_}; my $name = $p->{name} or die; my $value = $p->{value} || 123; }
But there's many other ways (Super Search for threads on passing parameters) to do it, including mucking directly with @_

In reply to Re: Parsing C Source File Functions. by davidrw
in thread Parsing C Source File Functions. by Ace128

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.