in reply to Re^2: Command Line
in thread Command Line

I was trying to replace the line mentioned with
next if ( $find_flag and ( if ($replacement == "") { /\s+QUALIFIED_C +LOCK/ } else { /\s+$replacement/ } ));
But it writes me "syntax error". I cant understand why... What I'm trying to do is check whether I entered a string and then look for it, and If not, look for QUALIFIED_CLOCK .

Replies are listed 'Best First'.
Re^4: Command Line
by holli (Abbot) on Oct 22, 2008 at 13:26 UTC
    like that?
    my ($iFile, $oFile, $searchFor) = @ARGV; $searchFor = quotemeta( $searchFor || 'QUALIFIED_CLOCK ); .... next if $find_flag and /\s+$searchFor/;


    holli, /regexed monk/
      The problem is that if I put a STRING, it will still delete me lines with QUALIFIED_CLOCK and not just lines containing STRING. I need it to do the following: If no STRING is inputted, skip lines with QUALIFIED_CLOCK, if is, keep lines with QUALI but skip lines with STRING.
Re^4: Command Line
by ww (Archbishop) on Oct 22, 2008 at 13:25 UTC
    Hint: Try counting your open and close parens, per block.
      I'm counting and it still looks alright. 3 "(" 3 ")" , 2 "{" and 2 "}" .