mc007 has asked for the wisdom of the Perl Monks concerning the following question:
So i pass a string to another function, which is read by SED. I have to use line numbers due to duplicate text entries in the text file im editing. In the sed line, im saying edit the first line.Substitue anything in that line with the word test. The second test (commented out) does a reverse video to highlight that text. Can anyone give me pointers as to how i can write the above in perl.#!/usr/bin/ksh test1() { eval sed -e $1 testfile > testfile2 } test1 "'1s/.*/test /'" #test1 "'1s/.*/ '$(tput smso)'broken'$(tput rmso)' /'"
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Convert from Sed to Perl
by runrig (Abbot) on Apr 08, 2008 at 20:09 UTC | |
|
Re: Convert from Sed to Perl
by oko1 (Deacon) on Apr 08, 2008 at 22:16 UTC |