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>


Reply via email to