#!/usr/bin/perl -w use strict; use warnings; my $MATCH_FILE="/path/to/patterns.pl"; my @LOGE; # this is an array that should be "configured" by the pattern.pl my $return; unless ($return = do $MATCH_FILE) { warn "couldn't parse $MATCH_FILE: $@" if $@; warn "couldn't do $MATCH_FILE: $!" unless defined $return; warn "couldn't run $MATCH_FILE" unless $return; } print $return; # this prints 2 printLogPatterns(@LOGE);