Dave, technically you are correct about escaping the dot, but in this particular situation my regexp is working. I will escape the dot. my goal again is to print from one sting to another.... from "allsets" down. I apologize for the long output if data, but I want to reflect 100% accuracy.
Any ideas on a simple for loop with a regexp? thanks Dave Gray <[EMAIL PROTECTED] om> To beginners@perl.org 08/02/2005 02:19 cc PM Subject Re: reg exp using \G Please respond to Dave Gray <[EMAIL PROTECTED] om> On 8/2/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I think I am on the right track as far as what assertion to use. I need to > print from one string to another using .. with \G Why do you want to use \G? > My goal is to capture from allsets down. > Here is my code: > > #!/usr/bin/perl > use strict; > use warnings; > $ENV{PATH} = qq(/opt/SUNWsamfs/sbin:/usr/bin); > open (ARC, "archiver -lv |") or die $!; > > foreach (<ARC>) > { > ##-- Tape --## > if (/allsets/ .. /fs_clinical.1/) You need to escape dots in regular expressions '\.' > { > print $_; > my $tape =$1; Your regex isn't capturing anything, so $1 will always be undefined. > } else { > / \G 'heartlab.1'/ What are you trying to do here? You need to escape dots in regular expressions '\.' > } > } > close (ARC); I think you would benefit greatly from trying to generalize your problem and writing a simple test script that simulates the problem you're trying to solve. Then if you're still stuck, post that test script here, as opposed to that 5 billion line data file which is mostly irrelevant anyway. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response> -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>