Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
perl -i -pe 's/\.mbh_succ_roam_i_vlr_e_plmn/\.new_mbh_succ_roam_i_vlr_ +e_plmn/g' <input_file>
when I run the perl oneliner with the input file all 3 lines are getting changed. what is the change should I need to make to change only first line. In other words how can I change the code to affect only if the word matches neglecting the rest of lines.file content, __DATA__ .mbh_succ_roam_i_vlr_e_plmn next .mbh_succ_roam_i_vlr_e_plmn1 first .mbh_succ_roam_i_vlr_e_plmn2 verify
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: regex change should be applied in iputfile
by GrandFather (Saint) on Jun 01, 2007 at 04:40 UTC | |
|
Re: regex change should be applied in iputfile
by McDarren (Abbot) on Jun 01, 2007 at 04:47 UTC | |
|
Re: regex change should be applied in iputfile
by blazar (Canon) on Jun 01, 2007 at 15:22 UTC |