Re: I'm doing something stupid

2013-10-04 Thread shawn wilson
I had to sleep on it and then the solution was stupidly obvious (as I knew it would be). However, now I'm having the problem I didn't think I would have - the ANSI sequences are showing up as printable (as well as taking some effect) in the print. However the escape that should turn the text back

Re: I'm doing something stupid

2013-10-04 Thread Shawn H Corey
On Fri, 4 Oct 2013 11:40:48 -0400 shawn wilson ag4ve...@gmail.com wrote: foreach my $ereg (@$match) { my $enum = ($#{$ereg-[0]} = $#{$ereg-[1]} ? $#{$ereg-[0]} : $#{$ereg-[1]}); print ereg . Dumper(@$ereg); print blah . $ereg-[0][0] . \n; # Each match foreach my $i (0 ..

Re: I'm doing something stupid

2013-10-04 Thread shawn wilson
Thanks, that works. The only other gotcha I had (which took 5 seconds to figure out - just for archival) was: my $clen = length($color); . substr($line, $ereg-[0][$enum], 0, $color); substr($line, ($ereg-[1][$enum] + $clen), 0, \e[0m); On Fri, Oct 4, 2013 at

I'm doing something stupid

2013-10-03 Thread shawn wilson
From position 0 to 7 should be whatever GREP_COLOR export is defined as. There might be issues with how I'm doing that but my main issue (I think) is how I'm looping (and/or how I'm using substr). #!/usr/bin/perl use strict; use warnings; use Data::Dumper; my $line = 'foo bar baz ball'; my

Re: I'm doing something stupid

2013-10-03 Thread Rob Dixon
shawn wilson ag4ve...@gmail.com wrote: From position 0 to 7 should be whatever GREP_COLOR export is defined as. There might be issues with how I'm doing that but my main issue (I think) is how I'm looping (and/or how I'm using substr). #!/usr/bin/perl use strict; use warnings; use Data::Dumper;