I
believe I understand what you're asking here and if my answer doesn't help I apologize.
These are a couple of very simplistic methods you might be able to use, or might be able to spark your imagination with. Again, I'm only about 50% confident I understand what your asking...
1. You will probably not want to do something like this because of a number of reasons. First '|' regexes are prety expencive, combined with not having any anchors, a possibly infinate size array in @tags(), it could be quite an intensive process. However, if the array is to remain very static and somewhat small it
might be a viable solution:
my @tags = qw( 1= 2= 3= .. );
my $reg_ex = join( '|', @tags );
open FILE, 'dat.log' || die "$!\n";
while ( <FH> ) {
print "$_\n" if ( $_ =~ /$reg_ex/s );
}
I had more examples, but I am quickly realizing I don't fully understand the problem enought to continue. Some questions that come up are:
1. Does the array @tags() have the potential of growing very large?
2. Is the contents of the file going to be consistant. For instance, will lines always start with 'tag=...' or will it be invariable?
3. Is there any more general detail you might be able to expose?
My answer, again, might help out (and hope it does). Other than that, I'm not sure what else to say...
---hA||ta----
print map{$_.' '}grep{/\w+/}@{[reverse(qw{Perl Code})]} or die while ( 'trying' );