guyov1 has asked for the wisdom of the Perl Monks concerning the following question:
The command line should be of the form: CODENAME INPUTFILE OUTPUTFILE STRING so my code will edit INPUTFILE, print the result to OUTPUTFILE and replace "QUALIFIED_CLOCK" with STRING. Thanks!#!/usr/intel/bin/perl use warnings; use strict; my $find_flag; #using a flag variable while ( <> ){ if (/^\S/){ #match a line that start wit +h no space if (/^\w+clk\[\d+\]/){ #match requested headline $find_flag = 0; } else{ $find_flag = 1; } } next if $find_flag and /\s+QUALIFIED_CLOCK/; #skips the line req +uested print qq{$_}; #printing ordinary +line }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Command Line
by toolic (Bishop) on Oct 22, 2008 at 12:39 UTC | |
|
Re: Command Line
by holli (Abbot) on Oct 22, 2008 at 12:30 UTC | |
by guyov1 (Novice) on Oct 22, 2008 at 12:41 UTC | |
by guyov1 (Novice) on Oct 22, 2008 at 13:06 UTC | |
by holli (Abbot) on Oct 22, 2008 at 13:26 UTC | |
by guyov1 (Novice) on Oct 22, 2008 at 13:42 UTC | |
by ww (Archbishop) on Oct 22, 2008 at 13:25 UTC | |
by guyov1 (Novice) on Oct 22, 2008 at 13:39 UTC | |
|
Re: Command Line
by gone2015 (Deacon) on Oct 22, 2008 at 12:51 UTC |