[Kc] RegExes

Frank Wiles frank at wiles.org
Tue Apr 1 10:00:16 PDT 2008


On Mon, 31 Mar 2008 20:34:58 -0500
"Emmanuel Mejias" <emmanuel.mejias at gmail.com> wrote:

> I think I figured it out. How's that look, better?
> 
> #!/usr/bin/perl -w
> 
> @input = `cat /etc/syslog.conf`;
> 
> foreach $line (@input) {
>   if ($line =~* /\var\/log/*){
>      print $line;
>   }
> }
> 

  The asterisks there aren't correct.  It should be like this: 

  if( $line =~ /\/var\/log\// ) { 
      print $line; 
  }

 -------------------------------------------------------
   Frank Wiles, Revolution Systems, LLC. 
     Personal : frank at wiles.org  http://www.wiles.org
     Work     : frank at revsys.com http://www.revsys.com 



More information about the kc mailing list