[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] Know tell me that this is a bug???



Can anybody tell me why this precompiling regex block below bombs
immediately with system error type 11 on a PowerMac? Does MacPerl
actually handle the "eval" syntax correctly? Is there a known issue with
that one?

Anyhow, it's quite annoying, these weird crashes. Anyone a hint? Oh, and
by the way, did any of you develop a real fast method for applying many
varying regular expressions to large files? I would be very pleased to
see some here on the list!

And here's the once bomber:

#!/usr/bin/perl -w
use strict;
use vars qw($filter1);
use subs qw(&FILTER_MATCHER &FILTER_MATCH_OR);

	@ARGV = "Hard Disk 516:Refbuster:reflogs:vref_10.3.-16.3.97.ref";
	
	$filter1 = FILTER_MATCH_OR qw{
            ^http://www[2]*.virtuoso-net[euroseek]*.com
            ->\s/virtuoso/
            [_]*[bB][lL][aA][nN][kK][_]*.[hH][tT][mM]\s->
            };

		while ( <> ) {
        	unless (&$filter1) {
			push (@TRUE, $_);
			$count_true++;
			next;
			}
    	}

	sub FILTER_MATCHER {
        my $condition = shift;
        my @regexp = @_;
        my $expr = join $condition => map { "m!\$regexp[$_]!o" }
(0..$#regexp);
        my $match_func = eval "sub { $expr }";
        die if $@;
        return $match_func;
    }

	sub FILTER_MATCH_OR  { FILTER_MATCHER('||', @_) }

Thanks in advance!

Philippe Wiede
mailto:pwiede@virtuoso-net.com

***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch