http://www.perlmonks.org?node_id=874591


in reply to Re: simple regex question
in thread simple regex question

pipeops, glad to hear you have it working. But for future reference, please wrap your <code> in tags - it's MUCH easier to read:

foreach $line (@exceptions) { if ( $line =~ m/^n/ ) { $line =~ s/^n//s; push( @before, $line ); } elsif ( $line =~ m/^i/ ) { $line =~ s/^i//s; push( @implementation, $line ); } elsif ( $line =~ m/^b/ ) { $line =~ s/^b//s; push( @backup, $line ); } elsif ( $line =~ m/^o/ ) { $line =~ s/^o//s; push( @offline, $line ); } }