in reply to Parse String Question

$ perl -le' my @a = qw( SystemMaj MemoryCrit ServerOkay MemoryOkay ); foreach my $v (@a) { my @x = split /(Crit|Maj|Okay)/, $v; print "1: $x[0] 2: $x[1]"; } ' 1: System 2: Maj 1: Memory 2: Crit 1: Server 2: Okay 1: Memory 2: Okay

Replies are listed 'Best First'.
Re^2: Parse String Question
by fujiman (Novice) on Sep 19, 2008 at 01:04 UTC

    Thank you both!