> > my (@lines, $num) = ((), 4);
>
> You are assigning the list ((), 4) to @lines and nothing to $num. Perhaps you
> meant:
>
> my ( $num, @lines ) = ( 4, () );
>
> Or simply:
>
> my ( $num, @lines ) = 4;
Indeed, good catch.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional comman
On Tue, 8 Mar 2005 15:26:28 -0500, Dave Gray <[EMAIL PROTECTED]> wrote:
> > > Something like (untested):
> > >
> > > my (@lines, $num) = ((), 4);
> > > while () {
> > > push @lines, $_;
> > > shift @lines if @lines == $num+1;
> > > print 'lines '.($.-$num+1).' to '.($.)." match\n"
> > > i
Dave Gray wrote:
This is the multi line pattern in which I wish to match:
String 1.2.3.4.5.6
One way to solve this would be to read lines from the file and save
chunks of N lines (4 in this case) in a temp variable. Then your regex
would operate on enough of the file to have a chance of workin
> > Something like (untested):
> >
> > my (@lines, $num) = ((), 4);
> > while () {
> > push @lines, $_;
> > shift @lines if @lines == $num+1;
> > print 'lines '.($.-$num+1).' to '.($.)." match\n"
> > if join('',@lines) =~ /regex goes here/;
> > }
> >
>
> That assumes that the pattern bei
On Tue, 8 Mar 2005 13:42:44 -0500, Dave Gray <[EMAIL PROTECTED]> wrote:
> > This is the multi line pattern in which I wish to match:
> >
> >
> > String 1.2.3.4.5.6
> >
> >
>
> One way to solve this would be to read lines from the file and save
> chunks of N lines (4 in this case) in a temp va
> This is the multi line pattern in which I wish to match:
>
>
> String 1.2.3.4.5.6
>
>
One way to solve this would be to read lines from the file and save
chunks of N lines (4 in this case) in a temp variable. Then your regex
would operate on enough of the file to have a chance of working.
Am Dienstag, 8. März 2005 17.20 schrieb William Melanson:
> Greetings,
Greetings too :-)
>
> This is the multi line pattern in which I wish to match:
>
>
> String 1.2.3.4.5.6
>
>
>
> This is what I have:
>
> ==
> #!/usr/bin/perl -w
>
> m