The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




Thread: Piping in Perl
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #4 (permalink)  
Old 09-03-2008
Raynon Raynon is offline
Registered User
  
 

Join Date: Sep 2006
Location: Sg
Posts: 350
Hi sysgate,

Think if($string =~ m/(AAA|BBB|CCC)/) is an OR function.

In short, the purpose of the below csh shell actually grabs the lines which contain both the term AAAand BBB.
However, the Perl code which you showed me will only grab those lines containing either AAA or BBB or both.

Can anybody give me some advice ?
Was wondering if the below Perl code can work ?

Code:
 if($_ =~ "AAA" && $_ =~ "BBB" ) 
{print "We've got a match!\n"}