in reply to Re: replace field
in thread replace field

I tried to do +> but it seems to empty the file. About $val+1, according to the program logic the digit there will always be single digit, so there is no problem of additional bit. So the only problem now, is to open the file and grep a key and then replace the 2nd field. So anything else I can do now...?

Replies are listed 'Best First'.
Re^3: replace field
by BioLion (Curate) on Jul 31, 2009 at 15:54 UTC

    Maybe you could use Tie::File ? You can process the file as an array and modify the lines in place using ikegami's suggestion.
    HTH!

    Just a something something...
Re^3: replace field
by Anonymous Monk on Jul 31, 2009 at 13:32 UTC
    > means CLOBBER the file (ie delete, recreate)