At 12:06 PM 4/18/05 -0700, bruce wrote:
>that's sort of what i had thought about. my perl's rusty. the issue i have,
>is that the line with the 'svn_roots:' may/will have subsequent lines that
>are part of the block. i'd like to be able to add the new information, as
>the last line of the block...

I kinda figured that.  Then just modify it a little.

@lines = <FILE>;
$x = 0;
foreach $line (0 .. $#lines) {
        if ($lines[$line] =~ m/^svn_roots = /) {
                ## We've found it, do some work
                ## $x contains the offset of the svn_roots line
                push @svn, $lines[$x];
                while ($lines[++$x] =~ m/^\t\w+:/) {   
                        ## Regex should be whatever indent is
                        push @svn, $lines[$x];
                }
                &dowork([EMAIL PROTECTED]);
                print $lines[$x]; # Regurgitate whatever came after svn block

        }
        else {
                ## It's not a line we want, so just regurgitate
                print $lines[$x];
        }
$x++;
}

>#file comments...
>svn_roots:  foo: /fffff,
>            dog: /ggggg,
>
>#continue file
>#blah....






--
REMEMBER THE WORLD TRADE CENTER         ---=< WTC 911 >=--
"...ne cede males"

00000100

_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to