Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
is it possible to set $. so that it will edit lines 1,4,7,10 etclocal $/ = "# input for "; while (<FILE1>) { ($hash, $input, $for, $aa) = split( /\s+/, $_) if /^\# \input\b.*/; if ($aa =~ /LEU\b/) {$. ==1 && s/ (.*)/$z3leu $z2leu $z1leu $1/} if ($aa =~ /ALA\b/) {$. ==4 && s/ (.*)/$z3leu $z2leu $z1leu $1/}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: $. Input line number
by Roy Johnson (Monsignor) on Apr 14, 2004 at 15:52 UTC | |
|
Re: $. Input line number
by Fletch (Bishop) on Apr 14, 2004 at 16:00 UTC | |
|
Re: $. Input line number
by davido (Cardinal) on Apr 14, 2004 at 16:49 UTC |