{local($^I,@ARGV)=('.bak','file.txt'); while(<>){ #the current line is now in $_, the line in the new edited file is wha +t ever I will print now(to ARGVOUT which is already select()ed) if ($.==$linenumberiwanttochange){ chomp; #edit the line print "$_\n"; #print the edited line }else{print} #leave the other lines with no change } }
In reply to Re: Using Files
by Ido
in thread Using Files
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |