"be consistent" | |
PerlMonks |
Re: Char replacementby dakkar (Hermit) |
on Apr 02, 2003 at 12:55 UTC ( [id://247482]=note: print w/replies, xml ) | Need Help?? |
"second string in each row" means exactly what? You have to perform two steps:
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
In Section
Seekers of Perl Wisdom
|
|