in reply to Want to get regexp list from file
Regarding your post, try to add <pre>..</pre> around the code.
Regarding your problem, try something like:
Sorry but I didn't test the code, but I hope this helps. Good luck.my $regexp = shift; my $text = shift; open RE, $regexp; while(<RE>) { chomp; push @re, $_ } close RE; open TXT, $text; while(<TXT>) { for my $re (@re) { print if m!$re! } } close TXT
Update: Thanks to ambrus for correcting my code.
Alberto Simões
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Want to get regexp list from file
by ambrus (Abbot) on Mar 26, 2005 at 20:39 UTC | |
|
Re^2: Want to get regexp list from file
by Fletch (Bishop) on Mar 27, 2005 at 01:12 UTC |