in reply to Regexes loaded from file

#!/usr/bin/perl -w open SUBS, "subs.txt" or die; my $sub = eval "sub { " . join('', <SUBS>) . "}"; die "Unable to complile subs.txt : $@" if $@; close SUBS; open STRINGS, "strings.txt" or die; while(<STRINGS>) { &$sub; print; } close STRINGS;

-sam

Replies are listed 'Best First'.
Re: Re: Regexes loaded from file
by samtregar (Abbot) on May 02, 2002 at 18:25 UTC
    Now why would this get downvoted? That's a working, efficient, tested solution to the problem posted! What do you want, a dance routine to go along with it?

    -sam

      Don't worry Sam... I thought this was a neat piece of code u put and it does exactyl what I asked. Nice one :)