Actually, I need it to swap lines Only if it matches a given pattern, like the sed example. I have some other lines Around the ones in the example which need to stay where they are. Where can I read more about s2p? I'm using perl on a network where they Think they've gotten rid of it-- everything I've tried so far works and compiles (when I get all the bugs fixed in my code) but I might not have everything. Thanks