Well, taking into account the many suggestions i've recieved from both here and from fellow programmers (thank you, who's responded), i've done it! This is what i've come up with...
sub adj3_gi { my $path='\\'; my $computer = "LAIN"; foreach(@_) { # skip if it doesn't start with either a space or backslash, or if + it starts with " ." or " .." next if ((/^[^ \\]/) || (/^ {2}\.{1,2}\s/)); # process path if first char is '\' if (/^\\/) { chop; $path = "$_\\"; } # break apart returned directory and file info elsif (/^ {2}(.*?(\.([^\.]+?))?) {5} *([HDRSA]*) +(\d+) {2}(.*)/gi +`) { #print "{$computer\:$path$1, ". (defined $3 ? $3 : "").", $4, +$5, $6 }\n"; } } }
putting everything in that one regexp made everything much faster. However theres one anomaly that i don't quite understand. I played a little with the options at the end of the regexp, mainly "g" and "i".
with g: 4 wallclock secs ( 3.91 usr + 0.00 sys = 3.91 CPU) with gi: 4 wallclock secs ( 3.64 usr + 0.00 sys = 3.64 CPU) with i: 7 wallclock secs ( 6.40 usr + 0.01 sys = 6.41 CPU) with none: 6 wallclock secs ( 6.77 usr + 0.00 sys = 6.77 CPU)
I ran this several times, and the results were all similar. Now i could *possibly* understand the g making things faster. but the i? i was always under the impression (from both professors and fellow coders) that the /i would make things slower. Noone i asked can explain it. Or is this more regexp voodoo? ^_^

In reply to Re: Re: Happy fun regexping by cyberconte
in thread Help needed with reducing function to a single regex by cyberconte

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.