in reply to multiple regex logical AND

If you are playing with configuration files, a configuration file module will do most of the work and hide a lot of the complexity. Users like to do odd thing such as using whitespace around elements, using different quotes, and other things which the modules can handle and make the regexes unruly:

#!/usr/bin/perl use ConfigReader::Simple; my $file = "/Users/brian/Desktop/config.txt"; my $config = ConfigReader::Simple->new( $file ); print "Has both JRECOV and TEOJ\n" if( $config->get( "JRECOV" ) eq 'yes' && $config->get( "TEOJ" ) eq '-w' );
--
brian d foy <brian@stonehenge.com>
Subscribe to The Perl Review

Replies are listed 'Best First'.
Re^2: multiple regex logical AND
by bigswifty00000 (Beadle) on Dec 13, 2006 at 16:57 UTC

    Very interesting! Thanks! I'd still like to be able to do a "grep like thing" for other searches