in reply to Char replacement

"second string in each row" means exactly what?

You have to perform two steps:

  1. find the beginning of that "second string"
  2. change its first char

For step 2, you can use s///, tr///, or substr. Other have already said how.

For step 1, it depends on how you separate strings. If your strings are separated by spaces (no quoting/escaping), I'd write: $line =~ s/^(\S+\s+)0/${1}2/; meaning:

-- 
        dakkar - Mobilis in mobile