> Suggestion: rather than use egrep (which, as Chas points out, requires > a new process - and ignoring his solution for a moment - sorry), it > might make more sense (and increase portability) to move the RegEx > parsing into Perl. > > my $var = grep {/This|That/}, `cmd --arg1 --arg2; > (Did I do this right? I'm not very familiar with grep)
Actually, I very quickly saw what I was doing was silly. I moved to something a little different for that portion: my $var = `cmd -arg`; if ($var =~ /(expr0|expr1|expr2|expr3)/) { Do stuff; } This seemed to work! I was able to reuse the code for the other scenarios while only executing the system call once which was actually a lengthy resource intensive op. Probably a million other *and* better ways :) Thanks for the help guys! jlc -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/