in reply to between pattern search not working
OUTPUT:use strict; use warnings; #my @array1 = `cat $ARGV[0]`; #my @array2 = 'cat $ARGV[1]'; my @array1 = ("BIG_TREE\n"); my @array2 = ( ' DATA: CREATE TABLE TEMP.BIG_TREE ;', ':', ':', '-------', 'foo', ); my $read01 = 0; foreach my $i (@array1) { for (@array2) { chomp($i); $read01++ if $read01; #s/./ . /g; if ( /CREATE TABLE TEMP\.$i/ ) { $read01 = 1; } $read01 = 0 if (/^----/); next if ( $read01 == 1 ); next unless $read01; print "$_"; } }
::
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: between pattern search not working
by Anonymous Monk on Jan 15, 2015 at 19:24 UTC | |
by BillKSmith (Monsignor) on Jan 15, 2015 at 20:29 UTC | |
by Anonymous Monk on Jan 15, 2015 at 21:06 UTC | |
by Anonymous Monk on Jan 16, 2015 at 11:59 UTC |