in reply to line by line match on an array of strings

You could look at the any() function from the List::MoreUtils module. I think it would be something like so:

#!/usr/bin/perl -w use strict; use List::MoreUtils qw(any); my @typedefs = qw(do re me fa so la ti do); while ( my $line = <DATA> ) { if ( any { $line =~ /$_/ } @typedefs ) { # perform various actions here if line match print $line; } } exit 0; __END__ do me a favour will you

This prints:

do me favour

UPDATE

From the docs:

Using the functions from this module however should give slightly better performance as everything is implemented in C.

Hope that helps =)


Smoothie, smoothie, hundre prosent naturlig!