James Edward Gray II wrote: > Then you didn't read the documentation I sent you the link for. ;) > > A negative index counts backwards from the end of the string.
i did read it. maybe i should have asked my question like this: "why is the 3rd argument negative when you can simply say: substr($str1, 4, 4, $str2); instead of substr($str1,Â4,Â8Â-ÂlengthÂ$str1,Â$str2);" but now i understand. Gunnar precisely followed the specs to my problem where i said i only know the offsets into the string of the section that i want to replace. i should have said i knew the offset into the string and also the length of the section i want to replace. with that info, we can use substr($str1, $offset, $len, $str2) and avoid the negative argument. thank you for the help, both of you. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>